20091022 Pesky files that just won't upload

In the process of creating a blog entry, we encountered a problem uploading an attachment file -- a 20K .pdf file -- that should have loaded just fine. But it didn't, and Drupal kicked out an error message about it being too big.

The problem was that the error message was wrong. The system was having trouble with the file NAME, not the size. It just didn't know quite what to do with a filename like "M66 and 67 Final Ballot Title Coalition Objections.pdf".

The solution was simple enough: replace the space characters in the name with underscore characters. The upload module accepted "M66_and_67_Final_ Ballot_Title_Coalition_ Objections.pdf" just fine (I added a couple of spaces in the name just for formatting on this page; no spaces were in the name used to upload).

Which begs a second comment: do filenames have to be attempts to set the Guinness record for longest sentence?

Advice: keep filenames reasonably short, and space-free. We don't have to pretend we are using DOS, but we shouldn't pretend that any filename, no matter how complex, is perfectly OK, either.

Tom Harrison

Republican News


News & Views