Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internet Transfer control

Status
Not open for further replies.

danetjorosho

Programmer
Jul 16, 2003
20
0
0
US
I need to post to an asp page on the web passing three parameters.
One is a file that is locally and the anothers are just strings
I know I need to use Content-Type: multipart/form-data format, but I can not find how to do it
 
This seems like an http question. Choose a forum that addresses the web package you are using eg Frontpage.

 
The asp page is already created
I need to post from access
 
I'm using this code, but the asp does not start the process

FileNumber = FreeFile
Open "C:\myimport.zip" For Binary As #FileNumber
varFileContent = Input(LOF(FileNumber), #FileNumber)
lngDataLen = LOF(FileNumber)
Close #FileNumber

strRequestHeader = "Content-type: multipart/form-data; boundary=--BOUNDARY" & vbCrLf
strHeaders1 = "--BOUNDARY" & vbCrLf & "content-disposition: form-data; name=" & """Var2""" & vbCrLf & vbCrLf & """White""" & vbCrLf
strHeaders2 = "--BOUNDARY" & vbCrLf & "content-disposition: form-data; name=" & """Var1""" & vbCrLf & vbCrLf & """Red""" & vbCrLf
strHeaders3 = "--BOUNDARY" & vbCrLf & "content-disposition: form-data; name=" & """MYZIPFile""" & "; filename=" & """C:\myimport.zip""" & vbCrLf & vbCrLf & varFileContent & vbCrLf
objFTP.Execute "XXX/process.asp", "POST", strHeaders1 & strHeaders2 & strHeaders3 & vbCrLf & "--BOUNDARY", strRequestHeader '& vbCrLf & "Content-length: " & Len(strHeaders1 & strHeaders2 & strHeaders3 & vbCrLf & "--BOUNDARY")
Do While objFTP.StillExecuting
DoEvents
Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top