File downloads link from user tab only works once...

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

I believe this has been reported before, but I didn't fully understand the bug report. It seems the files tab on a user's account uses links that only work once. This is no bueno if a user screws up the first download and clicks the link again... especially if it's already using JS to update the download count. We either need a page refresh here or should use JS to also update the download link to the next valid value.

Version: 
Ubercart 1.0
affinity's picture
Offline
Joined: 08/22/2008
Juice: 39
Applies to pages/paths with SSL Certificates in IE 7 only?

This apparently was discussed before in the forums. The problem, as far I can replicate it, is that after one attempt at download in a user's account, the link expires. My client's site is secure (https), and the problem only occurs in IE 7, not Firefox.

Here is the link to the forum discussion:

http://www.ubercart.org/forum/support/4303/how_user_connects_their_file_...

It doesn't seem to have been resolved. I tried the workaround suggested in the foirum thread, but no go. For any shopping cart site that operates a secure certificate and file downloads, this would make Ubercart a no-go. So I'm wondering if this issue can be upgraded?

Thanks!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Applies to pages/paths with SSL Certificates in IE 7 only?
Assigned to:affinity» torgosPizza

I wouldn't call it a "no-go" because it does work, albeit with intermittent problems. I've been digging in uc_file lately, I'll give these minor changes some testing and see if I can get anything to stick.

--
Help directly fund development: Donate via PayPal!

affinitymc's picture
Offline
Joined: 08/24/2008
Juice: 6
Update
Assigned to:torgosPizza» affinitymc

It's certainly not a Drupal or Ubercart problem, as it has been reported in several other instances elsewhere, and on the Micro$oft support webite:

http://support.microsoft.com/kb/323308
http://support.microsoft.com/kb/812935
http://support.microsoft.com/kb/316431
http://support.microsoft.com/kb/815313

All in all it seems to be a problem to do with the Cache-Control headers. I will experiment with them a bit and report back on the results. My aim is to have a zero-defect file download functionality on Drupal/Ubercart...I think it's possible!

affinitymc's picture
Offline
Joined: 08/24/2008
Juice: 6
Next Update

Here's what I tried, and it worked:

In uc_file.module, on lines 1086 to 1089, I changed the code to:

'Pragma: public',
      'Expires: 0',
      //'Cache-Control: no-cache, must-revalidate',
      'Cache-Control: public',

...and now the files download in IE7. While I am happy with the result, not being a coder, I have no idea what the implications of these changes are, so any insights would be most appreciated!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Next Update
Assigned to:affinitymc» torgosPizza

That looks almost the same as what the verdict was in the original thread. Maybe that wasn't the same one you linked to?

In any event, this would only cause a problem if someone is utilizing a caching or content delivery network, and / or if the business makes a lot of updates to their files. The issue is that sometimes the file will be updated but the user will still see the old download. Or, instead of seeing a download, they get a "404" page because that's the page that was cached in the delivery network, rather than the actual download.

However I think these are fringe situations and if that fix works, I'll do some research and testing to see if there is any real harm that can come from it.

--
Help directly fund development: Donate via PayPal!

affinitymc's picture
Offline
Joined: 08/24/2008
Juice: 6
Re: Re: Next Update
Assigned to:torgosPizza» affinitymc

Yes, I went back to the original thread and made changes based on it, the only difference was commenting out that one line.

Many thanks for your help!