Jump to content

Issue with readfile() and download on at least one mobile browser


Recommended Posts

Just because it is cgi doesn't mean it has nothing to do with it. The issue they stated was that it loads the URL twice.


Later down, it was posted that android intended for that to happen. One request to see if it is a download. If it is, send another request to the download manager.

Did you send the right URL? There's nothing about "twiice" there.


Also, it fails on iOS.

Link to comment
Share on other sites

Well done, SocialCloud, what you've posted there definitely is the answer on Android. I am having someone else verify iOS right now. Basically the fix is to bump up the number of retry attempts that the user has configured. (It was 1; should change to 2.) Seems like a hack...


But as expected, it's not a code issue. Thanks for finding that. I'll mark something solved as soon as I know about iOS.

Link to comment
Share on other sites

So in the code above, there's a user-configured option $download_attempts_allowed. This person had it set to 1, and most people set it to 2.  Because each Android request to download is two calls:

1) One call is made (now that's one attempt)

2) Another call is made  (now the attempt is too many, so it wants to return to the other page; everything is confused which is why the new header request probably overrides the first one or something).


So by changing this person's configuration to allow two calls, the second call works. It's a hack. What I'll have to do for real is to disallow an attempt when there's already one file downloading, or to check the timestamp on when it started. But for right now I can change this person's attempts allowed to 2 and there's no issue. 


On iOS it appears to be similar, but no one has yet to determine if there's a good way to download mp3s onto iOS, because Apple wants people to use iTunes only. Some people have issues with mp3s on Apple, others don't. I'm not sure what the answer is there but it's not for this forum.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.