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:
- Access denied – Drupal 6.x
- Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. (SOLVED!)
- How to take Ownership of a Drive, Folder or File in Windows 7
- Beginning Drupal
- Invalid argument supplied for foreach in template.php
- Windows 7 file copy and Internet slow – solved
- IIS and Drupal – Enable Clean URL’s
Tags: drupal
5 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!
- 7129/6105195 Edward Leedskalnin’s anti-gravity – How he built Coral Castle.
- How to take Ownership of a Drive, Folder or File in Windows 7
- WordPress widgets not saving or dragging?
- Firefox – update favicon.ico (SOLVED)
- IE emulator for FireFox
- Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. (SOLVED!)
- Access denied – Drupal 6.x
Archives
- February 2012
- November 2011
- September 2011
- August 2011
- June 2011
- January 2011
- December 2010
- November 2010
- October 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- January 2009
- December 2008
- August 2008
- June 2008

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
Thank you for the tip. I was experiencing the same problem and your solution resolved it.
Thanks! I needed that exact information…worked like a charm.
Thank you for this! Saved me hours of searching.