|
-
Jun 25th, 2001, 07:43 AM
#1
General Questions about the MS Inet Transfer control
Hello everyone!
Being quite a newbie to Inet-programming, I got some questions to you pro-guys:
I use the Inet control to download files from the Internet. I do this by using this function:
Public Function Download(Location As String, Filename As String, DirToSaveTo As String)
Dim DownloadURL As String
DownloadURL = Location & Filename
Dim bData() As Byte
Dim intFile As Integer
intFile = FreeFile()
bData() = Inet1.OpenURL(DownloadURL, icByteArray)
Open DirToSaveAt & "\" & Filename For Binary Access Write _
As #intFile
Put #intFile, , bData()
Close #intFile
End Function
Now my questions are:
1.
Is this the best way to do it? It seemed to be the easyest, and it doesn't need tons of code...
2.
I want to let the user see the progress using a progress bar. For this I need to know the filesize of the File that's downloaded. How do I get this (at best using the same Inet control).
Thanks for your help, hope I'll get some soon...
-
Jun 25th, 2001, 09:55 AM
#2
Use the Microsoft Common Dialog Control, very simple to use.
-
Jun 25th, 2001, 07:25 PM
#3
nope, this doesn't work, or I'm to stupid. I need the Dialog where I can point to the path, not a file. And I still would like to know how I get the filesize and received bytes or something like that so I can make a Progress bar.
PLEASE HELP!!!
-
Jun 26th, 2001, 12:10 AM
#4
So, make a new form, put the drive list and dir list and put an ok and cancel button, simple.
-
Jun 26th, 2001, 04:17 AM
#5
thanks, already thought of this but believed there's a better way using standard dialogues, but this works as well...
So what about showing the download status? Noone here who knows anything???
-
Jun 26th, 2001, 04:35 AM
#6
All I know is that the size information comes in the header.
-
Jun 26th, 2001, 06:36 AM
#7
Thanks again, but I figured a quite acceptable way to get it working with the winsock, so my problems are solved.
-
Jun 26th, 2001, 11:31 PM
#8
My I ask how did you get the size with winsock?
-
Jun 28th, 2001, 12:14 AM
#9
Junior Member
Your Path problem
As for your common dialog problem, why not open a Save As Dialog just before you start transferring bytes. Since you already know the file you're getting, you can set the filename property of the common dialog control to that filename. Once you click Save, the full path will be returned in the filename property. You can extract the path by using a
Left(filename, len(filename)-len(downloadfilename)).
Cameron
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
|