We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE3: Members can't upload PDFs

How Do I?

dwatson's avatar
dwatson
22 posts
8 years ago
dwatson's avatar dwatson

Not sure what to do here. I created a site and made a Members group with 1 person in it. They are unable to upload specifically PDFs in any channel entry. The message they get is “Cannot upload file. This file couldn’t be written to disk”. They have permission to upload to the directory, the permissions on the upload folder and subfolder were set to 777, and there is unlimited space on the server. They can upload other files but not PDF. I, as super admin, can upload PDFs no problem. How can this be fixed?

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
8 years ago
John Henry Donovan's avatar John Henry Donovan

This may be a security thing. You could try specifying the member group ID to exclude from XSS cleaning in your config.php and testing then.

EE Docs : xss_clean_member_group_exception

       
Senad Milavic's avatar
Senad Milavic
6 posts
8 years ago
Senad Milavic's avatar Senad Milavic

Or if you want to enable PDF uploading in general, for all groups, you can disable xss filtering altogether thru Control Panel by going to Settings/Security & Privacy and at the end of the list set “Apply XSS filtering?” option to “No”.

       
Billy Patel's avatar
Billy Patel
284 posts
8 years ago
Billy Patel's avatar Billy Patel

I am also getting a similar issue, where i am trying to upload a pdf from within an entry and in the file manager and i keep getting

===
Cannot Upload File

File not allowed.
===

I have xss filtering off and allowed types set to all. Paths are correct as i can upload images ok. I have even gone as far as outputting the $_FILES array to check the mime type which is coming back as a pdf.

At a loss as to what else to try. Any ideas?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
8 years ago
Ingmar Greil's avatar Ingmar Greil

An issue with the PDF? Are you able to upload other file types? Can you do it as a Superadmin?

       
Billy Patel's avatar
Billy Patel
284 posts
8 years ago
Billy Patel's avatar Billy Patel

Tried other pdf’s without luck. Also tried as a superadmin. Also thought it might have been my local environment so tried on the production server and still nothing.

Getting a bit embarrassing as i recommended EE and now cant get it to do something as simple as upload a pdf.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
8 years ago
John Henry Donovan's avatar John Henry Donovan

Hi Billy,

what version of EE3 are you using? Was this an upgrade or first time install?

In your Upload Directory settings what do you have Allowed file types? set to? Technically a PDF is an image but can you try setting this to All File Types if not already

       
Billy Patel's avatar
Billy Patel
284 posts
8 years ago
Billy Patel's avatar Billy Patel

I managed to get it working by setting it all up again from scratch. Not sure why it didnt work first time. My problem solved. Thanks for responding.

       
tbritton's avatar
tbritton
714 posts
8 years ago
tbritton's avatar tbritton
This may be a security thing. You could try specifying the member group ID to exclude from XSS cleaning in your config.php and testing then. EE Docs : xss_clean_member_group_exception

Thanks, John - I ran into this same problem, and I feel better doing this selective config repair over turning off the XSS filtering globally.

Almost perfect solution… but how would I simply remove PDF’s from the XSS filter list??? That seems it would be a better answer still.

Terry

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.