Download permissions

8 posts by 3 authors in: Forums > CMS Builder
Last Post: December 9, 2008   (RSS)

By andycal - August 3, 2008

I've just had an issue where a customer uploaded some Word documents to a page (using an upload field) but when using the site and trying to download them, the file permissions were set to 'read' for the 'owner' only so they wouldn't download.

The upload directory permissions were set to 777.

Anyone else had this?

Re: [andycal] Download permissions

By Dave - August 4, 2008

Hi Andycal,

That's pretty unusual. Do all newly uploaded files have no-read permissions for everyone but owner or just those word documents? Check the permissions on the files themselves, not the directory.

Let me know and we'll see if we can track down the cause.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Download permissions

By andycal - August 5, 2008

Hi Dave,

I've tried with PDFs too. Even though the directory is set to 777, any documents become '600'. Images are fine though.

Odd!

Re: [andycal] Download permissions

By Dave - August 5, 2008

Do you manage your own server or use a web host? If you like you can send me FTP and CMS login details to dave@interactivetools.com (email, don't post login details to forum) and I can take a look.

I'll either be able to fix it or create a sample script that demonstrate the problem to your host for them to fix it.

You could also try checking with your host first. Let me know how we can best assist.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Download permissions

By JonGunnar - December 8, 2008

I am having the same problem. Did you find a solution to the problem? Its only with PDF files, images are fine.

Re: [JonGunnar] Download permissions

By Dave - December 8, 2008

Hi JonGunnar,

I think this last one was a server configuration issue.

If you like you can send me FTP and CMS login details to dave@interactivetools.com (email, don't post login details to forum) and I can take a look and see if that's the same problem here.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Download permissions

By JonGunnar - December 9, 2008

The server is on a closed network.

How come that image files work fine but the PDF's dont work? Both are uploaded the same way. Same form, same page.

Re: [JonGunnar] Download permissions

By Dave - December 9, 2008

I'm not sure, but we can track it down. We'll just have to test a few things.

Are there any other PHP scripts on the same server? If so try uploading a pdf through those and see if that works.

Next, in CMS Builder, upload a pdf and another file and check the file permissions, file date, and owner (if you can see that through ftp) of the pdf files versus the other file and let me know if there are any differences.

Try uploading a pdf file that you've renamed to something else that otherwise works, see if that makes a difference.

If none of that gives us a clue I'll make you a simple upload script that is only a few lines so we can try and reproduce the problem outside of CMS Builder.

My first guess is the files are being created in the temp upload dir that PHP uses (defined by the server admin in php.ini) with incorrect permissions. Since we're just copying them we get whatever permissions the server created them with.

Let me know what you find out.
Dave Edis - Senior Developer
interactivetools.com