I've been trying for a while to upload a picture to my profile, but I keep getting:

"The selected file xxxxx.jpg could not be uploaded. Only JPEG, PNG and GIF images are allowed."

I have pictures enabled in user settings (dimensions at 100x100, size at 100kb)... and I think I have all the other settings correctly labeled. The pictures folder has the correct permissions. I've tried gifs, jpgs, and pngs with no luck. Does anyone know what I can check to fix this?

Here's a status report if you need any of that info:

Access to update.php Protected
Configuration file Protected
Cron maintenance tasks Last run 1 hour 14 min ago
You can run cron manually.
Database updates Up to date
Drupal core update status Up to date
File system Writable (public download method)
GD library bundled (2.0.34 compatible)
Module and theme update status Up to date
MySQL database 5.0.45
PHP 5.2.4
PHP memory limit 128M
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Update notifications Enabled
Web server Microsoft-IIS/5.1

Comments

vm’s picture

what are the dimensions and file size of teh image you are uploading ? does it fall within the parameters set ?

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

Cerulean’s picture

I've tried a variety of 100x100, 75x75, and 50x50 images, biggest file size was about 90kb, smallest in the single digits. None worked.

vm’s picture

I wouldn't know where to start diagnosing this on IIS.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

zilla’s picture

doublecheck that you not only have pictures enabled, but also that you have set user permissions to allow for upload - after making sure that you've enabled uploads...picture size (original) won't matter because it will be resized automagically...might also want to make sure that the write permissions on upload folders are correct and all of that too, though it sounds like its something else...

Cerulean’s picture

Check. Check. Check. Everything seems to be in check.

I'm gonna go over everything a couple more times...

The only thing I've flagged as a possible problem is the "Picture image path:" under User Settings. It just says "picture", and I'm going to try adding different combinations of slashes to see if it helps.

And, I was able to upload a picture in creating content (story/page).

zilla’s picture

one random thing to check: under admin/file system - make sure it's public access (not sure if this maps to user pics, but worth a doublecheck)

Cerulean’s picture

Well, after everything I had tried, nothing worked. I decided to go find what file that error was coming from... which took a while (I used the indexing service to index *.php, *.module, *.inc, etc so I could search them). I searched for "uploaded." with the period, and only one file came up which wasn't part of the phpbb3 forums... includes/file.inc. Here's the code that seems to cause the problem (lines 556-567):

    // Check for validation errors.
    if (!empty($errors)) {
      $message = t('The selected file %name could not be uploaded.', array('%name' => $file->filename));
      if (count($errors) > 1) {
        $message .= '<ul><li>'. implode('</li><li>', $errors) .'</li></ul>';
      }
      else {
        $message .= ' '. array_pop($errors);
      }
      form_set_error($source, $message);
      return 0;
    }

When I commented all of those lines, I successfully uploaded a picture. I'm hoping someone can tell me how to fix this without commenting out those lines, or if I should keep those lines commented out.

motto’s picture

Hello, even though I avoid editing core-includes like the plague I found no other way of getting around it.

I'm running IIS6 at the moment and will upgrade to IIS7 in about a week. I'll let you know if the validation-error is still present then.

Rather then commenting the lines you displayed I just prevented filling the $errors array. (lines 551-554) The rest I left untouched.

    // foreach ($validators as $function => $args) {
    //   array_unshift($args, $file);
    //   $errors = array_merge($errors, call_user_func_array($function, $args));
    // }