http uploading by using VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SCRjyw0808
    New Member
    • May 2007
    • 2

    #1

    http uploading by using VBA

    Hello,all,

    Is it possible to upload files through HTTP protocol by using VBA (Access)?

    Many thanks

    carol
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by SCRjyw0808
    Hello,all,

    Is it possible to upload files through HTTP protocol by using VBA (Access)?

    Many thanks

    carol
    As far as I know, there is no built-in functionality within Access that will accomplish this. I'm sure that it can be accomplished using the API or 3rd Party Controls.

    Comment

    • pks00
      Recognized Expert Contributor
      • Oct 2006
      • 280

      #3
      I would think that using WinInet would be the best approach
      Note its great for small files, I dont think its that great for large files

      http://msdn.microsoft.com/archive/en...asp?frame=true

      search google and u should find examples

      Comment

      • SCRjyw0808
        New Member
        • May 2007
        • 2

        #4
        Originally posted by ADezii
        As far as I know, there is no built-in functionality within Access that will accomplish this. I'm sure that it can be accomplished using the API or 3rd Party Controls.
        I have tried on programming by using webbrowser embeded into VBA (access) but there is a problem on posting the username and password:


        URL = "--------" ' A URL that will accept a POST
        Flags = 0
        TargetFrame = ""
        postdata = "'Username =username&Password=password"

        postdata1 = StrConv(postdat a, vbformUnicode)

        Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
        WebBrowser1.Nav igate URL, Flags, TargetFrame, postdata, Headers

        WebBrowser1.Req uery
        but it seems that the website doesn't recognize it. Is there anyone who could tell me what is wrong in the codes? thanks

        Comment

        • JConsulting
          Recognized Expert Contributor
          • Apr 2007
          • 603

          #5
          Originally posted by SCRjyw0808
          I have tried on programming by using webbrowser embeded into VBA (access) but there is a problem on posting the username and password:



          but it seems that the website doesn't recognize it. Is there anyone who could tell me what is wrong in the codes? thanks
          not sure how you're applying your Inet however, this may help.
          Code:
          'When using the Internet Transfer control, set the URL property before you set 'the Password and UserName properties. Currently, if you set the URL property 'last, the UserName and Password properties will be set to "". This code will 'work:
          Inet1.URL = "HTTP://www.myCompany.com"
          Inet1.Password = "I(3Lei#4"
          Inet1.UserName = "Jonne Smythe"
          Inet1.Protocol = icHTTP
          Inet1.OpenURL
          Another option is to pass the username and password as part of the URL

          Use this syntax

          http://username:passwo rd@mysite.com:8 080/

          J

          Comment

          Working...