Closed (fixed)
Project:
ImageField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2007 at 13:00 UTC
Updated:
20 Jan 2010 at 20:48 UTC
Private downloads currently don't work perfectly, because as long as $_SESSION['imagefield'] contains the concerned file, it will be downloaded with _imagefield_preview() instead of file_download(). Which doesn't work.
This patch fixes that problem by clearing up session (imagefield_clear_field_session() on the respective field) when an imagefield is newly stored (either inserted or updated), so when the node is viewed there is no session variable for that field left. Which makes it work.
Please review and apply (the patch is for the DRUPAL-5--2 branch).
| Comment | File | Size | Author |
|---|---|---|---|
| imagefield_private_downloads.patch | 822 bytes | jpetso |
Comments
Comment #1
quicksketchThanks jpetso! I've wrapped your patch into part of http://drupal.org/node/123977, as it helps with that issue also. This should be committed shortly. Thanks!
Comment #2
quicksketchSorry, that other issue seems to be caused by something else... I'll apply this as it's own commit.
Comment #3
quicksketchCommitted to all branches. Thanks!
Comment #4
(not verified) commentedComment #5
mschiff commentedHi,,
I am having this issue with drupal 6.15 and imagefield 6.x-3.2 (Link Image Field 6.x-1.x-dev is also affected)
I am using an imagefield and private downloads the the image URL starts with /system/files/. As authenticated user it works, but as anon user this will give a "file not found" error
(Note: not a permission denied error! Browser shows the broken image icon)
If I switch to public downloads all works well.
Comment #6
mschiff commentedsorry for the noise, permissions error, only the "Link Image Field 6.x-1.x-dev" Module is affected