PDA

View Full Version : Attachments Download as 0 Bytes


samuch
05-11-2008, 05:12 PM
When users email in with attachments it shows the attachment name and the correct size. However when we click on it to download, it saves as 0 bytes.

I checked the permissions on the attachments folder and it's temoprarily 777 (for troubleshooting) and the subfolders are 744.

The index.php/debug/check shows everything is good and it's build 595. Now that I recall, we've always had this issue. It's just very seldom someone sends us an attachment so I didn't pay any mind to it until now when I actually needed the attachment ;)

Any thoughts?

Hildy
05-12-2008, 06:04 PM
744 means they're read only, and it's possible you're using a different user than expected for writing attachments... I'd suggest temporarily chmod -R 777 /storage/attachments and see if that fixes it. If so, then you just need to identify *which* user should own the files and directories and chown it to that correct user (and then chmod back to 755).

samuch
05-15-2008, 10:32 PM
Hey Hildy,

Changing to 777 did fix this issue. I'm curious though, how could these have been set to the wrong premissions? Aren't they created by the setup script?

Also, shouldn't the debug script check these permissions?

Hildy
05-19-2008, 07:34 PM
No, the directories are created by you, when you either a) unzip the zip or b) download with svn. UNIX and variants can also have cascaded effects when creating directories and permissions, and it's likely just something that was done on your system as a security measure.

Note that you really don't want to leave those perms at 777; you need to identify *which* user should have access to those files (usually your web user) and set permissions accordingly.