Help! “The file could not be written to disk” when uploading PDFs in Expression Engine 2

I ran into this problem this week.  I made a folder, set my permissions, and was stumped to find I couldn’t upload my files.  I found through some trial and error that this only applied to PDFs as other people were uploading their images just fine.  Equally as confusing, I could indeed still upload PDFs as a Super Admin.  So I was convinced Expression Engine was broken in regards to member permissions.

But with some research on the new EE2 settings, I found out how to fix this.  (note, it’s a bit of a workaround, but hey, it works)

In the control panel: Admin -> Security and Privacy -> Security and Sessions
Set “Apply XSS Filtering to uploaded files?” to “No”

When the EE2 came out, the XSS security settings was added to help when pdf files appear to have problems. If you trust your uploaders, turning it off should be okay.  People in forums are starting to realize that those XSS security settings may be a bit too strict to actually be useful.
(Of course, you should first make sure that folder has permissions for your user group, that might be your solution on its own.)

4 Comments so far »

  1. Jeff Bond said

    am October 9 2012 @ 1:37 pm

    Ran into this issue earlier today and this solution worked like a champ!

  2. J said

    am December 13 2012 @ 7:05 pm

    Cheers for this!

    Client reported this issue, and got it sorted within minutes – all thanks to you!

  3. Stephanie Ross said

    am April 24 2013 @ 12:05 pm

    Thanks so much!!! Ran into this problem today in front of a Client – yikes!! You saved my bacon.

  4. R said

    am May 20 2013 @ 12:14 pm

    Thanks!!

Comment RSS

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: