|
-
May 14th, 2006, 02:16 PM
#1
Thread Starter
New Member
Problem with Inet1
when i try to get some file the inet1 get me only half!
for example: if i have 1mb file it get me only 0.5
why?
The code:
Dim file As String
Dim file2 As String
Private Sub Command1_Click()
file = Inet1.OpenURL("http://www.dr-vb.co.il/files/logo_top1.jpg", icByteArray)
file2 = Inet1.GetChunk(2048, icString)
Do While Len(file2) <> 0
DoEvents
pb1.Value = pb1.Value + 1
file = file & file2
file2 = Inet.GetChunk(2048, icString)
DoEvents
Loop
Open "d:\desk5.jpg" For Binary Access Write As #1
Put #1, , file
End Sub
my english isn't very good..
-
May 14th, 2006, 09:49 PM
#2
Hyperactive Member
When your dreams come true.
On error resume pulling hair out.
-
May 15th, 2006, 02:53 AM
#3
Thread Starter
New Member
Re: Problem with Inet1
Its works but! when i try to get file from FTP the program sayd :"This call is not valid for an FTP connection"
the infected code:
VB Code:
Size = CLng(Inet1.GetHeader("Content-Length"))
all the code:
Private Sub Command1_Click()
Dim Size As Long, Remaining As Long, FFile As Integer, Chunk() As Byte, file As String
file = "ftp://nadavsen2 [email protected]/1.txt"
Inet1.Execute file, "GET"
Do While Inet1.StillExecuting
DoEvents
Loop
Size = CLng(Inet1.GetHeader("Content-Length"))
Remaining = Size
FFile = FreeFile
Open "c:\logo.txt" For Binary Access Write As #FFile
Do Until Remaining = 0
If Remaining > 1024 Then
Chunk = Inet1.GetChunk(1024, icByteArray)
Remaining = Remaining - 1024
Else
Chunk = Inet1.GetChunk(Remaining, icByteArray)
Remaining = 0
End If
Put #FFile, , Chunk
Loop
Close #FFile
MsgBox "File downloaded", vbInformation
End Sub
Last edited by Nadavsenior; May 15th, 2006 at 03:42 AM.
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
|