[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • 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?
0
str_kani
Asked:
str_kani
  • 2
2 Solutions
 
BrownheadCommented:
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:

'//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
'\\Code//
0
 
BrownheadCommented:
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.

http://vbforums.com/showthread.php?t=337424
0
 
inthedarkCommented:
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
http://support.microsoft.com/default.aspx?kbid=239588

PRB: CGI Applications Hang Under IIS 4.0 and above With POST
http://support.microsoft.com/default.aspx?kbid=203298

You receive a "The specified CGI application misbehaved" error message
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q145/6/61.asp&NoWebContent=1

0
 
str_kaniAuthor Commented:
do you think the the http upload will be fast and reliable than the ftp?  
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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