Drupal – The selected file… could not be uploaded. Only JPEG, PNG and GIF images are allowed
I’m using Drupal 6.13, I tried to change the logo for the admin template and got this error message. A little bit of digging turned up a comment made by zbricoleur on the Drupal.org site where he provides a working solution.
In /includes/image.inc, change line 117 from:
if (!is_file($file)) {
to:
if (!is_file($file) && !is_uploaded_file($file)) {
That line above works nicely, however next up you might see the error:
The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
To get around that problem do this:
Administer/File-System
You might find it under the 'Site configuration' heading and then File System.
There you will see a box that has: Temporary Directory
c:\windows\temp and change it to the same as the line above it which will probably be
sites/default/files
Save configuration and you're good to go.
PS. Nobody leaves a comment if I help them, please let me know if this solution worked for you…
Related posts:
- Drupal Clear Top ‘page not found’ errors – How to?
- Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. (SOLVED!)
- Drupal mailhandler smtp localhost error
- Drupal Gmail Module – Solved.
- IIS and Drupal – Enable Clean URL’s
Tags: drupal
2 Comments
Leave a Reply
Hot Topics
- Creating a Drupal 6 custom login form - Step by Step tutorial.
- WordPress Contact Form 7 & WP-Mail-SMTP problem solved
- imagecache wrong path - SOLVED!
- Adobe Contribute CS4 - cannot verify your connection Information.
- IIRF Drupal, WordPress and IIS6 - How to get them working first time - Guaranteed!
- Drupal - The selected file... could not be uploaded. Only JPEG, PNG and GIF images are allowed
- Learning About Drupal
- Feeling sick after watching IMAX - Avatar
- Wordpress widgets not saving or dragging?
- How to take Ownership of a Drive, Folder or File in Windows 7
- 7129/6105195 Edward Leedskalnin's anti-gravity - How he built Coral Castle.
- Why do I need to keep resetting my router?
- IIS and Drupal - Enable Clean URL's
- IIRF Wordpress - URL Rewriting for IIS6.0
- Windows 7 Problems.
- Drupal mailhandler smtp localhost error
- Is it Moore's Law or the Microsoft Inverse Square Law?
- Contact
- Drupal Gmail Module - Solved.
- IIS7 - No HTTP redirect icon

I was getting the same error when uploading files.
Changed the tmp directory to reside inside of the files folder and it resolved the error.
Thanks for posting this.
Cheers!
A good tip there, thanks for adding your experience (it will be added to our own – resistence is futile) – lol
Simon