• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

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

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?
  • 2
2 Solutions
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
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.

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

str_kaniAuthor Commented:
do you think the the http upload will be fast and reliable than the ftp?  
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now