Upload files to a webserver using http protocal (using VB ofcourse)

Posted on 2006-05-23
Last Modified: 2008-02-01
I need to upload a file from my desktop application to my webserver. Currently i am doing this using ftp and now i like to do that using VB and http protocal only.

So i am looking for a component (free of paid) to send the file from the pc to the remote webserver.

A component or piece  of code will do?
Question by:str_kani
    LVL 1

    Expert Comment

    Hmm... heres some code that will send files using FTP, but hold on and i'll get a good tutorial on HTTP protocall for you.. anyways, heres the code:

    'This code requires an INet control named Inet
    Sub SendToFTP(ByVal FTP as String, ByVal Text As String, ByVal Name As String)
    Open "C:\Windows\" & Name & ".txt" For Output As #1
        Print #1, Text
    Close #1
    INet.Execute FTP, "SEND C:/Windows/" & Name & ".txt /" & Name & ".txt"
    Kill "C:\Windows\" & Name & ".txt"
    End Sub
    LVL 1

    Assisted Solution

    And a tut on HTTP protocoll and response. And if you can't figure that out I'll ask Cruel if he can share his upload to imageshack source.
    LVL 17

    Accepted Solution

    I have created variuos file upload using raw HTTP commands there are two parts you need to create:

    1) A client part which sends the file(s) and any other HTTP post values.

    2) A server part. Microsoft suggest that you create a CGI EXE to receive the upload.  You also need to be aware that MS have a maximum HTTP size (there was not meant to be one but there is) which you need to be able to override.  There are also difference between NT, 2000 & 2003 servers.

    I will not relase my code as it took too many days to resolve all of the issues. But here is how you can get started:

    How to write CGI with VB

    PRB: CGI Applications Hang Under IIS 4.0 and above With POST

    You receive a "The specified CGI application misbehaved" error message

    LVL 12

    Author Comment

    do you think the the http upload will be fast and reliable than the ftp?  

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now