[RESOLVED] Wierd download
I'm using a Inet thing to download a file. The file is called brain.txt.
here's the "ignition code":
VB Code:
Screen.MousePointer = vbHourglass
ProgressBar1.Value = 0
'ProgressBar1.Visible = True 'show progressbar
'This downloads the file and saves to your machine
Timer1.Enabled = True
If filen = "adam.exe" Then
DownloadFile "http://www.guitar.gratisplaneten.com/adam/" & filen, App.Path & "\adam_.exe"
Screen.MousePointer = vbDefault
And here's the DownloadFile code:
VB Code:
Public Sub DownloadFile(strURL As String, strDestination As String) 'As Boolean
Const CHUNK_SIZE As Long = 1024
Dim intFile As Integer
Dim lngBytesReceived As Long
Dim lngFileLength As Long
Dim strHeader As String
Dim b() As Byte
Dim i As Integer
DoEvents
With Inet1
.url = strURL
.Execute , "GET", , "Range: bytes=" & CStr(lngBytesReceived) & "-" & vbCrLf
While .StillExecuting
DoEvents
Wend
strHeader = .GetHeader
End With
strHeader = Inet1.GetHeader("Content-Length")
lngFileLength = Val(strHeader)
DoEvents
lngBytesReceived = 0
intFile = FreeFile()
Open strDestination For Binary Access Write As #intFile
Do
b = Inet1.GetChunk(CHUNK_SIZE, icByteArray)
Put #intFile, , b
lngBytesReceived = lngBytesReceived + UBound(b, 1) + 1
DownloadProgress (Round((lngBytesReceived / lngFileLength) * 100))
DoEvents
Loop While UBound(b, 1) > 0
Close #intFile
End Sub
My problem is that when I've downloaded the file, everywhere in it where there should be enters, there's instead a wierd box sign ( almost like this [] ).
How can I download the file normal, so I get it as it should be? :confused:
Plz help! :cry:
//Alex
Re: [RESOLVED] Wierd download