|
-
July 17th, 2001, 05:02 AM
#1
HTTP Upload - An Answer
I have seen a number of posts requesting how to upload a file programmatically via HTTP. Here is a solution in VB using the INet control.
Dim oFileSystem as new Scripting.FileSystemObject
s = "-----------------------------AaB03x" & vbCrLf & _
"content-disposition: form-data; name=""field1""; filename=""autoexec.bat""" & vbCrLf & _
"Content-Type: text/plain" & vbCrLf & vbCrLf & _
oFileSystem.GetFile("c:\autoexec.bat").OpenAsTextStream.ReadAll & _
"-----------------------------AaB03x--"
Inet1.Execute "http://localhost/sample1.asp", _
"POST", s, "Content-type: multipart/form-data, boundary=AaB03x"
Synopsis... A Request is formatted according to RFC1867 using the FileSystem object to insert the file content. It then posts it to the URL using the INet routines.
I can send more information upon request and please send me any feedback on this.
-
December 28th, 2001, 09:22 AM
#2
Re: HTTP Upload - An Answer
My requirement is to upload files from a vb application via HTTP.
Using INet Control seems to be useful.
Can I get more information regarding this?
-
January 15th, 2002, 08:01 AM
#3
Re: HTTP Upload - An Answer
I tried to use the code sample but, I got following Error: Cannot coerce type (Err.Nr: 35760) Can you help me??
-
February 13th, 2002, 03:33 AM
#4
Re: HTTP Upload - An Answer
I have a similar requirement. Pl give me more info at the earliest.
Archana
-
February 13th, 2002, 06:13 PM
#5
Re: HTTP Upload - An Answer
After some more work in this area I don't recommend this approach at all for a production environment. You would be better off using cURL or the libcURL libraries available at http://curl.haxx.se
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|