|
-
Oct 18th, 2000, 10:16 AM
#1
Thread Starter
Lively Member
Hi all,
I'm trying to ftp a file from a remote server. This file is a zip file so I also want to unzip it. However, the GET action of the INET control returns before the action is complete. I thought this scenario was what the StillExecuting property was for but it doesn't seem to be because 9 times out of 10 StillExecuting is False but the file can't be unzipped. If I wait (say) a minute, it can be unzipped so all I'm waiting for is the file buffer to be flushed or something. Calling DoEvents() doesn't help either.
Does anyone know how to get the size of a file that's sat on an FTP server? I can get the size of a directory but that's no help. If I know how big the file should be I can write my own little function to wait until it's all there.
Has anyone else come across this "feature" yet?
TIA,
Toot
Some cause happiness wherever they go; others, whenever they go.
-
Oct 18th, 2000, 11:06 AM
#2
Frenzied Member
Try the .Getheader 
Code:
Inet1.OpenURL "www.vbworld.net"
MsgBox Inet1.GetHeader("Content-length")
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 18th, 2000, 11:26 AM
#3
To get the full file without letting Inet to truncate it:
Code:
Dim strFile As String
Dim strTemp As String
strFile = Inet1.OpenURL("frp://ftp.site.ext/YourFile.ZIP")
Do
strTemp = Inet1.GetChunk(2048)
strFile = strFile & strTemp
Loop Until Len(strTemp) = 0
At the end of this code, strFile should contain the whole file.
I hope it helps.
Let me know.
Scorp
[Edited by Sc0rp on 10-18-2000 at 12:31 PM]
-
Oct 18th, 2000, 11:35 AM
#4
Frenzied Member
I suggest you download it in a byte array,
Code:
Dim strFile() As Byte
Dim strTemp As String
strFile = Inet1.OpenURL("frp://ftp.site.ext/YourFile.ZIP")
...
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
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
|