LLLLLLL Posted January 3, 2014 Author Share Posted January 3, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/284994-issue-with-readfile-and-download-on-at-least-one-mobile-browser/page/2/#findComment-1463758 Share on other sites More sharing options...
LLLLLLL Posted January 3, 2014 Author Share Posted January 3, 2014 Oh, sorry. Looks like you did put the wrong URL first and that's what I clicked. I'm looking at the other issue now. Quote Link to comment https://forums.phpfreaks.com/topic/284994-issue-with-readfile-and-download-on-at-least-one-mobile-browser/page/2/#findComment-1463759 Share on other sites More sharing options...
LLLLLLL Posted January 3, 2014 Author Share Posted January 3, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/284994-issue-with-readfile-and-download-on-at-least-one-mobile-browser/page/2/#findComment-1463760 Share on other sites More sharing options...
jazzman1 Posted January 4, 2014 Share Posted January 4, 2014 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... Realy? Quote Link to comment https://forums.phpfreaks.com/topic/284994-issue-with-readfile-and-download-on-at-least-one-mobile-browser/page/2/#findComment-1463782 Share on other sites More sharing options...
Solution LLLLLLL Posted January 4, 2014 Author Solution Share Posted January 4, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/284994-issue-with-readfile-and-download-on-at-least-one-mobile-browser/page/2/#findComment-1463783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.