David Powers Lesson10 - 'doesn't meet the requirements for an image'

Hi,
I have a  problem to upload image in lesson10. It always show the error message of 'doesn't meet the requirements for an image' even the image size, width and height meet the validation. Below is upload_images.php
My upload file size is 160K with width 640 pixels and height 480 pixels. Please help. Thank You.
upload_images.php
<?php
$uploader = new Zend_File_Transfer_Adapter_Http();
$uploader->setDestination($destination);
$uploader->setOptions(array('ignoreNoFile' => TRUE));
$files = $uploader->getFileInfo();
$filenum = 1;
foreach ($files as $file => $info) {
  $file = "photo{$filenum}";
  $caption = $_POST["caption{$filenum}"];
  if (isset($_POST["place_id{$filenum}"])) {
    $place_id = $_POST["place_id{$filenum}"];
  } else {
    $place_id = NULL;
  $filenum++;
  if ($uploader->isUploaded($file)) {
          $filename = $uploader->getFileName($file, FALSE);
          $uploader->addValidator('Size', FALSE, '500kB');
          $uploader->addValidator('MimeType', FALSE, 'image');
          $uploader->addValidator('ImageSize', FALSE, array('minheight' => 50, 'minwidth' => 100));
          if (!$uploader->isValid($file)) {
            $errors[$filename] = "$filename doesn't meet the requirements for an image";
          } else {
            $no_spaces = str_replace(' ', '_', $filename, $renamed);
            $uploader->addValidator('Extension', FALSE, 'gif, png, jpg');
            $recognized = FALSE;
            if ($uploader->isValid($file)) {
                    $recognized = TRUE;
            } else {
                    $mime = $uploader->getMimeType($file);
                    $acceptable = array('jpg' => 'image/jpeg' ,
                                                                      'png' => 'image/png',
                                                                      'gif' => 'image/gif');
                    $key = array_search($mime, $acceptable);
                    if (!$key) {
                      $errors[$no_spaces] = "$filename is an unrecognized image type";
                    } else {
                      $no_spaces = "$no_spaces.$key";
                      $recognized = TRUE;
                      $renamed = TRUE;
            if ($recognized) {
                    // get the names of existing files
                    $existing = scandir($destination);
                    // check if the name of the uploaded file is in the array
                    if (in_array($no_spaces, $existing)) {
                      // get the position of the final period
                      // use it to get the base name and extension
                      $dot = strrpos($no_spaces, '.');
                      $base = substr($no_spaces, 0, $dot);
                      $extension = substr($no_spaces, $dot);
                      // initialize a counter
                      $i = 1;
                      // use a loop to add the counter after the base name
                      // check whether the new name exists in the array
                      do {
                              $no_spaces = $base . '_' . $i++ . $extension;
                      }  while (in_array($no_spaces, $existing));
                      // set $renamed to TRUE
                      $renamed = TRUE;
                    $uploader->clearValidators();
                    $uploader->addFilter('Rename', array('target' => $no_spaces, $info['tmp_name']));
                    $success = $uploader->receive($file);
                    if (!$success) {
                      $errors[$no_spaces] = implode('. ', $uploader->getMessages());
                    } else {
                      $uploaded = "$filename uploaded successfully";
                      if ($renamed) {
                              $uploaded .= " and renamed $no_spaces";
                      $images[] = array('filename' => $no_spaces,
                    'caption'  => $caption,
                    'place_id' => $place_id);
                      $messages[] = $uploaded;

I solved it finally. For your infor, I'm using php version is 5.4.3 and MAMP 2.2. Here are the changes:
1) Open php.ini
    Look for 'extension=php_fileinfo.dll' and remove ;
2) Download GNU file package for windows from http://gnuwin32.sourceforge.net/downlinks/file-bin-zip.php.
    Extract the zip file.
3)  Copy 2 file from the extract folder ../share/file/magic and ../share/file/magic.mgc and paste in folder php/extra/magic
     folder. (Create the magic folder as new folder).
4) Stop MAMP all services and start services again.
This will work for you !

Similar Messages

  • HT6030 I downloaded Mail Update for Mac OS X 10.5.6 and was told it could not be installed because it was from an unidentified developer.  Tried installing download from MailUpdate & advised the disk did not meet the requirements for update. Hmmmm.

    I downloaded Mail Update for Mac OS X 10.5.6 and was told it could not be installed because it was from an unidentified developer.  Tried installing download from MailUpdate & advised the disk did not meet the requirements for update.   Expect it's due to being at 10.9.1.  Mail is still teetering between dysfunctional and non-functional.  Advice?

    I'm not sure what "Mail Update for Mac OS X 10.5.6" is. Mac OS X 10.5.6 is Leopard, a system that is quite old at this point. There have not been any Mail updates for Leopard in quite some time. If you are trying to install some old Mail update for Mac OS X 10.5.6 in Mavericks, that won't work.
    If you are trying to install the Mavericks Mail update manually, that's not necessary if you have updated through the App Store. If the App Store shows no updates, you don't need this. (The error message doesn't make sense, and may indicate some other problem with your system, assuming that you were downloading this update from Apple's site.)
    I'd advise you to start a new topic in the Mavericks forum and describe the problems you are having with Mail. Be sure to include specifics, but try to avoid speculating on causes, as responses that may be related to an inaccurate assumption on your part can cloud the issue.

  • Im trying to install a new application on my mac but it keeps on coming up with 'The volume of this disk does not meet the requirements for this update' any ideas how to solve this?

    I have recently fully updated my mac to 10.8.2 and i am trying to install a small facebook application but every time i come to chose the disk it says ' OS X facebook developer preview can not be installed on this disk. This volume of this disk does not meet the requirements for this update' any ideas on how to get round this?
    thanks

    That may be the new Mountain Lion "sandbox" protective software kicking in, possibly, because ML "thinks" that App doesn't meet ML's new strict security requirements.   A common phenomena.  If you feel the 3rd party App is really OK, you can override this feature and install the new App by holding down the Command key when you click to install the new App.  That's one possibility for the error message appearing.  If not, another possibility is that that Developer Preview software package requires some previous piece of software be installed prior to downloading this Preview.  You would have to check the Facebbok websiste's Developer Forums for help if this is the case.
    Hope this helps

  • My computer does not meet the requirements for iTunes 7.7

    Okay, so I think all these problems that I'm having are because my new computer does not meet the requirements for iTunes 7.7.
    The requirements are listed here: http://www.apple.com/itunes/download/
    I checked my system and I have:
    1. 1.60 GHz instead of 2GHz
    2. 511 MB RAM instead of 512 MB RAM
    I have no idea how to check MB for video RAM or MHz. Since it's not shown in system I'm assuming that this computer doesn't have any.
    The system requirements compared to mine are just off by a bit, but could this still be the problem?
    Also, could I use an older version of iTunes that will work with my system & could you please post the link for the download.
    Thanks in advance.

    Hi,
    Firstly, please let us know more details about the issue, such as:
    1. What is your network environment, workgroup or domain?
    2. How do you implement DirectAccess?
    Meanwhile, regarding the requirements, please see
    DirectAccess Requirements.
    More information:
    Networking and Access Technologies-
    DirectAccess
    Hope this helps.
    Jeremy Wu
    TechNet Community Support

  • I want to upgrade my 2008 Mac pro to the latest one, will it meet the requirement for the future Software that's coming out for the next four years?

    I want to upgrade my 2008 Mac pro to the latest one, will it meet the requirement for the future Software that's coming out for the next four years?.

    I'd wait. What can't you do that you need? You mean you want to buy a new model, then why not wait for an actual new one, not the two year old 5,1, when you need to and have outgrown.
    Yours will run Mountain Lion. yours is 4 yrs old and still supported and has life left.

  • 10.5.7 This volume does not meet the requirements for this update.

    First, 10.5.7 is not showing up in software update. I downloaded both the delta and combo 10.5.7 updates and they both give me "This volume does not meet the requirements for this update." I've done all the requisite stuff, permissions, volume check, reset PRAM, etc. I've downloaded the updates several times, and they worked on my 2008 iMac and 2007 Macbook Pro, so I know they work. I've searched and searched and can't find a resolution. It's as if there is some signature written to my boot volume that is preventing this update. Applecare was of no help either. Any ideas?

    Hi! Im new to this forum and i really dont know if this is the right place for me to say this but i really need some help! I have a MAc OS x 10.5.7 and had bootcamp installed on it so i could run both windows and mac! Over the last few days ive recieved a trojan virus on my windows... so i deleted my partition on mac so i basically just had Mac... now i am trying to reinstall my partition but disk utility is saying that i have an invalid volume free block count as it should be 41189365 instead of 41182017....argh! ive read the help stuff on it and it suggests me removing everything off my mac... but will i need 2 still have the mac install disc 1 to hand? as i have currently misplaced this and im ripping my hair out! Ive never had problems with my Imac until now and im really worried! I could really do with the help! Thanks Sam

  • Drives do not meet the requirements for Safari 4.0.5

    I have an original Power MAc G5 with daul 2 GHz processor running 10.5.8. I am currently running Safari 4.0.3 and would like to upgrade to 4.0.5, but the installation package stated that none of my drives meet the requirements for installation. What are the requirements for installation, my startup drive has over 100GB of free space.

    Ok..
    Try repairing disk permissions.
    Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    Carolyn

  • Mac OS X Update Combined can't be installed on this disk. This volume does not meet the requirement for this update?

    Hello everyone,
    I just purchased MBP 2.6 Ghz running Lion 10.7.3 and I am trying to install the Combo Update 10.7.4.
    After I launch the installer at the Destination Select step I get this message:
    Mac OS X Update Combined can't be installed on this disk. This volume does not meet the requirement for this update.
    The sharing and permission on Macintosh HD are "Read & Write" for system, wheel and everyone.
    Please Help
    Thanks

    Welcome to Apple Communities
    If it's a new MacBook Pro (2012), you have to update in  > Software Update. They need a special version

  • OS X update (10.9.4) can't be installed on this disk This volume does not meet the requirements for this update.

    I have the mac with following specs I need to update the OS X 10.9.4. I tried OS X Mavericks 10.9.4 Update to install manually but it says "OS X update can't be installed on this disk This volume does not meet the requirements for this update." Please help me.

    Click here and run the combo updater. The one you previously downloaded requires 10.9.3.
    (111238)

  • Tried to install Mountain Lion and it comes up with the following message  Mac OS X Update Combined can't be installed on this disk. This volume does not meet the requirements for this update. My laptop is using 10.7.3

    Tried to install Mountain Lion and it comes up with the following message  Mac OS X Update Combined can't be installed on this disk. This volume does not meet the requirements for this update. My laptop is using 10.7.3

    Go to  > Software Update and install updates. Finally, go to App Store, buy Mountain Lion and install. Open > http://www.apple.com/osx/specs/

  • Getting this:You cannot install Security Update 2011-002 on this volume. This volume does not meet the requirements for this update?

    I am getting this message: You cannot install Security Update 2011-002 on this volume. This volume does not meet the requirements for this update?
    is there a way to install this update?

    Hello
    More information would be useful, for example which Mac OS are you running.
    On the left menu item  About this Mac provides useful information.
    Also did you use Software Update to determine the update?
    Using Software Update can ensure you download and install the correct package for your particular Mac and OS version.

  • OS X 10.8.1 update cannot be installed on this disk. This volume does not meet the requirements for this update.

    HI
    I had installed mountain lion on my MBP 13" early 2012, but it has lots of issue, when i tryed to up date to 10.8.1 it shows the error "OS X update cannot be installed on this disk. This volume does not meet the requirements for this update"
    if i run the software update nothis is showing, current os version is 10.8

    This did not work for me.
    Note, that at one point the Apple developer knew exactly what the problem was and decided not to let us know. If we were tole what the problem was we woud have an idea of how to proceed.

  • HT6030 I can't install the update for Mail for Mavricks because it says "This volume does not meet the requirements for this update"? It's my iMac hardrive with 791GB available.

    I've recently installed Mavricks on my iMac and Mail went completely rouge on me. Tried switching to using Gmail directly but it's a terrbile user experience so I decided to install the new Mail update for Mavricks but have been geting this message. "This volume does not meet the requirements for this update"? My hardrive has 791GB available.

    Hi Allan,
    I thought I did explain it, but sorry if that wasn't clear.
    I get the little pop-up alert that tells me I have a new messages (Shows the sender and an abreviated version of the message) but those actual messages sometimes don't appear in my inbox until up to an hour later.
    Jason

  • Hard drive "does not meet the requirements" for system updates

    Hi,
    I'm running 10.2 and I'm trying to update my computer to the more recent version, except that I've gone through the update downloads on this site and anything higher than 10.3 tell me I need to run 10.3 to run it. When I tried to upgrade to 10.3, I was told that I "cannot install this software on this disk. This volume does not meet the requirements for this update". What does that mean and how do I rectify the problem? Thank you very much in advance.
    - Jen

    Hi Kappy! I have a similar problem: I had a problem in the past and had to re-install the system. I now have a previous sytem folder on my mac which I do not dare touch. I used to have a later version than 10.3.3 (I cannot remember which). I am now trying to update with the 10.3.9 combo update (just bought a new ipod) and I get the famous "does not meet the requirements" message. I have repaired permissions and done Onyx maintenance - still nothing. I wonder whether somehow the installer detects that there is already some newer component installed and does not want to re-install. I am awfully frustrated... Thanks in advance for your help.

  • HT1338 OS X Update can't be installed on this disk. This volume does not meet the requirements for this update.

    I am trying to update Mountain Lion to 10.8.2, but I get the error message:
    OS X Update can't be installed on this disk. This volume does not meet the requirements for this update.
    When trying to install on my hard drive?

    Welcome to the Apple Support Communities
    If you have the Late 2012 Mac mini, it requires a special OS X update that it's not available. Wait until Apple releases this update

Maybe you are looking for

  • Error while deploying BPEL Process

    Hi , I am new to BPEL and learning it using dev guide. i am using JDev 10.1.2.0.0 with OAS. i build a simple BPEL process which uses a DB adapter for interaction with DB. My DB tables are not related to each other in any way. please help for resolvin

  • How to create Exe From Data files

    my requirement is very much similar to registration of file extension. lets say if you have a file with extension .xyz then you can decide which program should invoke .xyz but instead of any other extension i need that extension of my file should be

  • How's the Zen Touch in sub-zero temperatu

    I li've in Canada Toronto, get some harsh winter here... probably a few degrees colder than New York... anyway, my question is how well does the mp3 player work in freezing temperatures? Does it hang more often? Not turn on? LCD screen all messed up

  • Problem in date format

    There is one date characteristic in my query , which has same format with infoobject 0DATE(yyyymmdd)...When I am executing the report that date field is displayed as mm/dd/yyyy , but in the dataprovider the same date field has been displayed as dd/mm

  • 2 way Connected Management Groups in OpsMgr 2007

    Hi, Are there any issues in having 2 way connected management groups in 2007R2. Site 1 is used in Jan, with Site 2 in standby but we want to see Alerts for Site 2 on site 1 so have connected Site 1 to Site 2 via connected management groups. Following