Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Photo Album Upload error

on some pictures i get

Your Photo could not be submitted

Image must be a GIF, JPEG or PNG file.

how ever i uploaded a similar one fine only does this on random pics
Your images could have bad headers ( damaged ) or they could be named with the wrong extension.
You can temporarly disable the upload check function from maincore.php

CodeDownload  
// Checking file types of the uploaded file with known mime types list to prevent uploading unwanted files
if(isset($_FILES) && count($_FILES)) {
   require_once BASEDIR.'includes/mimetypes_include.php';
   $mime_types = mimeTypes();
   foreach($_FILES as $each) {
      if(isset($each['name']) && strlen($each['tmp_name'])) {
         $file_info = pathinfo($each['name']);
         $extension = $file_info['extension'];
         if(array_key_exists($extension, $mime_types)) {
            //An extension may have more than one mime type
            if(is_array($mime_types[$extension])) {
               //We should check each extension one by one
               $valid_mimetype = false;
               foreach($mime_types[$extension] as $each_mimetype) {
                  //If we have a match, we set the value to true and break the loop
                  if($each_mimetype==$each['type']) {
                     $valid_mimetype = true;
                     break;
                  }
               }

               if(!$valid_mimetype) {
                  die('Prevented an unwanted file upload attempt!');
               }
               unset($valid_mimetype);
            } else {
               if($mime_types[$extension]!=$each['type']) {
                  die('Prevented an unwanted file upload attempt!');
               }
            }
         } /*else { //Let's disable this for now
            //almost impossible with provided array, but we throw an error anyways
            die('Unknown file type');
         }*/
         unset($file_info,$extension);
      }
   }
   unset($mime_types);
}

@Domi

Hey. On my brand new fresh install of 7.02.07 I have a user that tried to submit a photo and couldn't. He emailed me and attached the photo which is a valid jpg file @1600x1200. I then tried myself to do a submit and it failed for me also saying invaled filetype so I totally disabled the check in maincore as suggested and it still fails. I don't understand why this is happening.
The image could contain bad codes.
Most image upload sections should also run something called verify_image function, I woulden´t recommend disabling that, but in a controlled environment you could unless you have good means to manually verify that image.
Well I know for a positive fact that the pic is fine; also I tried several of my own pictures w/same result. The check in maincore just doesn't work right. I commented out the entire thing and all is good.
In user photo gallery Thread http://www.php-fusion.co.uk/forum/viewthread.php?thread_id=33340#post_182844
There are small bugs, and one of them is, you can not add files of lower case extension.
problem in file upload
only allows extensions JPG GIF PNG capitalized
testing in other versions 7.02
after upgrading
related errors
Prevented an unwanted file upload attempt!
7.02 07 new installation works fine

testing on other pages 7.02 05 and 7.02 06
have this error

Solution Update includes folder
use full package 7.02 07

after this - work well

is likely to miss include files in update packages
Thread Information
Author
Replies
7 posts
Views
3,910 times
Last Post
Last updated on 7 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Falk, Grimloch, Aokiji, jekov, Talocha