Hi, I'm testing around with file tranfer from my server to the file system of my app. I use OKHttpUtil2 and everything looks like working fine:
The file "test.gz" on the server is a 33MByte gzip-compressed file. It contains a single 80MB data-file
The file "test.abc" is a exact copy of the "test.gz", but I changed the extension to "abc"
When I start the dowload for both files, the time for loading "test.gz" is the same as for "test.abc". OK!
But the file size is different at the end!!!
The "test.abc" has still the 33MByte as expected.
The "test.gz" has 80MByte and this is exactly the size the file inside the gz has. It looks like the file was unzipped automatically.
I do not use any de-compressing code!
Is this normal?
The file "test.gz" on the server is a 33MByte gzip-compressed file. It contains a single 80MB data-file
The file "test.abc" is a exact copy of the "test.gz", but I changed the extension to "abc"
When I start the dowload for both files, the time for loading "test.gz" is the same as for "test.abc". OK!
But the file size is different at the end!!!
The "test.abc" has still the 33MByte as expected.
The "test.gz" has 80MByte and this is exactly the size the file inside the gz has. It looks like the file was unzipped automatically.
I do not use any de-compressing code!
B4X:
Sub Globals
Private Button1 As Button
Private MyJob As HttpJob
Private Zeit As Long
End Sub
Sub Activity_Create(FirstTime As Boolean)
...
MyJob.Initialize("MyJob", Me)
End Sub
Sub Button1_Click
Zeit=DateTime.Now
MyJob.Tag="test.abc"
'MyJob.Tag="test.gz"
MyJob.Download("http://www.MyServer.de/temp/" & MyJob.Tag)
MyJob.JobName="check"
End Sub
Sub Jobdone(Job As HttpJob)
Log("Jobname=" & Job.JobName)
If Job.Success=True Then
Log("Input Stream from internet")
Private MyStream As OutputStream
MyStream=File.OpenOutput(File.DirInternal,Job.Tag,False)
File.Copy2(Job.GetInputStream(), MyStream)
MyStream.Close
Log("Zeit download=" & (-Zeit+DateTime.Now))
Dim Liste As List
Liste=File.ListFiles(File.DirInternal)
For i=0 To Liste.Size-1
Log("Files=" & Liste.Get(i) & " " & File.Size(File.DirInternal,Liste.Get(i)))
Next
Else
Log("Error beim Download " & Job.ErrorMessage)
End If
Job.Release
End Sub
Is this normal?