Author Topic: Weird problem when downloading from 4images  (Read 72953 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Weird problem when downloading from 4images
« Reply #30 on: April 06, 2006, 02:47:42 PM »
then, what is the point of having sessions? ;) its not going to work like that...

but have you tryed v1.7.2? same problem?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Instigator

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Weird problem when downloading from 4images
« Reply #31 on: April 06, 2006, 03:23:12 PM »
Just tried 1.7.2 and have the same problem :(

Offline Instigator

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Weird problem when downloading from 4images
« Reply #32 on: April 09, 2006, 02:17:40 PM »
Sorry for being a nuisance but I really need help on this cos I'm at a dead-end :(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Weird problem when downloading from 4images
« Reply #33 on: April 09, 2006, 10:30:27 PM »
I dont have an answer for you...in fact so far nobody could answer this question on any of the forums I've asked...
and some people insist that they dont have such problem
i.e. http://www.codingforums.com/showthread.php?t=84007
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Instigator

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Weird problem when downloading from 4images
« Reply #34 on: April 10, 2006, 12:50:43 AM »
Hi Veno,

Thanks for your help. I will check that thread regularly myself and look elsewhere for an answer.

Thanks!

Offline Instigator

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Weird problem when downloading from 4images
« Reply #35 on: April 10, 2006, 01:21:35 AM »
Yes!! I have figured it out thanks to google :p

The fix is:

Before:
Code: [Select]
if (get_user_os() == "MAC") {
Add
Code: [Select]
session_write_close();
Source: http://www.sitepoint.com/blogs/2006/02/27/ajax-and-session-race-conditions/ and http://uk2.php.net/session_write_close

Edit: Sorry the file is download.php.
Explanation: In short the session data was not being written when download was in progress so the session was "locked" and could not be used. Using the write_close() function it meant that before the download starts the session data is written and made available. The inspiration was thanks to Veno who used the word "Lock up" and I used same on google to find my answer :D

thanks veno :D

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Weird problem when downloading from 4images
« Reply #36 on: April 10, 2006, 01:26:25 AM »
omg! great find!
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Instigator

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Weird problem when downloading from 4images
« Reply #37 on: April 10, 2006, 01:27:24 AM »
Added explanation :D Hope it helps :)