|
-
April 13th, 2001, 05:34 AM
#1
downloading from http
I am looking for a easy way to download files from http://www.infoplace.nl/files/... (the site is NOT online now).
I've tried the inet control but i cant make it work the way it should, i also tried UrlToDownload file but that keep giving me a byref error because it doesnt support variables (i think).
So if anyone has a solution, please speak out.
Thanks in advance,
Sebastian
-
April 13th, 2001, 07:10 AM
#2
Re: downloading from http
Try this
Private Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub cmdSave_Click()
Call URLDownloadToFile(0, "http://www.somesite.com/file.exe", _
"c:\path\file.exe", 0, 0)
End Sub
Iouri Boutchkine
[email protected]
-
February 13th, 2002, 07:44 AM
#3
Re: downloading from http
I have tried the code you suggested and it seems to work fine--do you also have the code for an upload??
-
February 13th, 2002, 07:52 AM
#4
Re: downloading from http
Check it out, but I did not try this.
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"
Iouri Boutchkine
[email protected]
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
|