Skip to main content
Participating Frequently
September 5, 2011
Question

URLStream download incomplete

  • September 5, 2011
  • 2 replies
  • 1079 views

Hello,

I use URLStream to download avi files.

The source file is ok because when i download it within web browser, i get it fully.

But threw my AIR app, the file downloaded is corrupted. I get a little difference between event.bytesTotal read from ProgressEvent, and the sum of myStream.bytesAvailable of every ProgressEvent plus the quantity received in CompleteEvent.

The result is a corrupted file, lacking of 500o to 1Ko for several Mo file.

It's not a 100% reproducing bug, but it is quite often...

Do you know what could be the cause of it?

Thanks

This topic has been closed for replies.

2 replies

Participating Frequently
September 5, 2011

I tried to download the same file with FileReference, and i got quite same result. The size downloaded is not the same than the size i got with a web browser.

So it seems that theres a bug in the flash platform...

The question is: does the issue appears with the file itself or the host from which i download it. Again i do exactly the same thing with other files, but with the same host, same url style etc.

chris.campbell
Legend
September 6, 2011

Hello,

It sounds like you're running into a buffer issue.  Is it possible to post a sample project so I can take a look at your code and see if I can reproduce the problem?  In addition, you might want to take a look at some sample code I wrote a while back that can deal with very large files and reading asynchronously.

http://forums.adobe.com/message/3428563#3428563

Thanks,

Chris

Participating Frequently
October 25, 2011

Hi,

sorry for the long time to answer.

I made several tests and here is what i get:

- on my windows 7, i have difference of 459 bytes between what i download, and what the file size is. In debug mod and realease mod.

- on a mac mini, i don't have this difference when i use the release version! I'm not sure if i have same AIR version installed. (i think it is)

- on both platforms i can receive the full file correctly when i download it from a browser. Thats why the bug is supposed to be from AIR.

- i have the bug if i use URLStream (with or without data catched in progress event). I have exactly the same difference of 459 bytes.

- i also have the bug if i use URLLoader. I have exactly the same difference of 459 bytes.

- its not linked to the size of the file. The file in use in the code below is very small: 328 204 bytes.

I give you the code i use for test:http://sebpatu.com/testDownAspi.fxp

If when you try the link for download, it is not valid anymore (because there's timeout) please send me mail and i'll generate a new link for you.

Thanks

Participating Frequently
September 5, 2011

Correction: the bug is 100% for a same file, but i don't get the bug for all files i download...