|
-
Jan 6th, 2003, 12:50 PM
#1
Thread Starter
Hyperactive Member
dowenloading large files with Inet
ok guys... this is a sub i created form a code i collected from somewhere.... but the thing is.. i cant.. donwload large files with it.. how do i correct this problem?
*******************************************
Private Sub Download(strURL As String)
Dim b() As Byte
Dim intCount As Integer
Dim strData As String
Inet.Cancel ' Stops any current operations
b() = Inet.OpenURL(strURL, icByteArray)
For intCount = 0 To UBound(b) - 1
strData = strData & Chr(b(intCount))
Next intCount
Open App.Path & NextFile For Output As #1
Print #1, strData
Close #1
MsgBox "d"
End Sub
-
Jan 6th, 2003, 02:42 PM
#2
Let me in ..
Re: dowenloading large files with Inet
Originally posted by deane034
ok guys... this is a sub i created form a code i collected from somewhere.... but the thing is.. i cant.. donwload large files with it.. how do i correct this problem?
*******************************************
Private Sub Download(strURL As String)
Dim b() As Byte
Dim intCount As Integer
Dim strData As String
Inet.Cancel ' Stops any current operations
b() = Inet.OpenURL(strURL, icByteArray)
For intCount = 0 To UBound(b) - 1
strData = strData & Chr(b(intCount))
Next intCount
Open App.Path & NextFile For Output As #1
Print #1, strData
Close #1
MsgBox "d"
End Sub
There is a direct API to download files from Net if you know the URL of the file. In your case i think you know the url in advance.
I think it is DoFileDownload API defined in shdocvw.dll
Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long
Just pass the file Url to it and it will do the trick for you.
-
Jan 7th, 2003, 08:20 AM
#3
Thread Starter
Hyperactive Member
thanks man ... i diddnt try it.. but it shud work right
-
Jan 7th, 2003, 11:57 AM
#4
Thread Starter
Hyperactive Member
well.. the DoFileDownload fucntion.. kinda opens up a iE dialouge box.. i dont want that.. is there any fix for the inet control... coz.. i think it's the size.. the page i am tryin to donwload has abt 70 000 characters...
-
Jan 7th, 2003, 01:29 PM
#5
Let me in ..
Originally posted by deane034
well.. the DoFileDownload fucntion.. kinda opens up a iE dialouge box.. i dont want that.. is there any fix for the inet control... coz.. i think it's the size.. the page i am tryin to donwload has abt 70 000 characters...
All you have to do is mark the checkbox on that window which says close automatically when download is done. You only have to do that once. From next time on if you download something it will download the file and close automatically.
Whats the problem in that ???
-
Jan 8th, 2003, 12:45 PM
#6
Thread Starter
Hyperactive Member
well.. no..coz.. this shud be automated.. that wud be iritattin
-
Jan 8th, 2003, 01:01 PM
#7
Let me in ..
Originally posted by deane034
well.. no..coz.. this shud be automated.. that wud be iritattin
Jesus Christ - Whats irritating with it. Its actually neat and better. It tells you all kinda information about download speed, how much download etc etc ...Even if it remain opens after download user can always close it. What does it takes to close a window.
Man u r some chooosy !!!
-
Jan 8th, 2003, 01:03 PM
#8
Thread Starter
Hyperactive Member
i feel i am a IE slave well.. anyeays.. i got this API
so.. i tihnk i;ll use this one..
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
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
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
|