Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4590548
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:16:04+00:00 2026-05-21T22:16:04+00:00

Hi all I’m trying to upload a image when creating a item in my

  • 0

Hi all I’m trying to upload a image when creating a item in my app, however the action fails returning the following error: The mimetype of file ‘mytestimage.jpg’ could not be detected.
I’ve tried adding a Mime Type validator but the error persists, can anyone tell me where I’m going wrong in the code below.

// Image uploads
$images = new Zend_Form_Element_File('images');
$images->setMultiFile(2)
       ->addValidator('IsImage')
       ->addValidator('Size',false,'5242880')
       ->addValidator('Extension',false,'jpg,png,gif')
       ->addValidator('ImageSize',false,array(
                 'minwidth' => 250,
                 'minheight'=>250,
                 'maxwidth'=>500,
                 'maxheight'=>500
                 ))
       ->setValueDisabled(true);

Many thanks in advance.

Graham

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:16:04+00:00Added an answer on May 21, 2026 at 10:16 pm

    I had the same problem.

    Zend_Frameworks tries to determine the mimetype in two ways:

    • First it tries to use the PECL FILEINFO-Extension (which is not installed on every server)
    • if the extension is not istalled it tries to use mime_content_type (a php function). This function however is deprecated as of php version 5.3

    So in this case I guess your hoster is using php version 5.3 and has not installed the PECL FILEINFO-Extension. Same goes unfortunately for my hoster 🙁

    Here are more details of the two ways in the php-manual:

    • http://de.php.net/manual/en/function.mime-content-type.php
    • http://de.php.net/manual/en/ref.fileinfo.php

    By the way. You can see the code ZF uses in the file “Zend\File\Transfer\Adapter\Http.php” (lines 1281-1318: methodname is _detectMimeType

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I'm trying to use the jQuery Form Validator (http://docs.jquery.com/Plugins/Validation). However I'd like to
All, Say I have the following divs: <div id=rotate_container> <div class=reviews id=item1>This is item
All I am trying to create an app that start capturing the video from
All throughout an application wherever error messages (or other user messages) are used I
All, Say I have the following bit of code: select: function(start, end, allDay) {
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
All, I am trying to create a table to receive user inputs (UGC). This
All, I have the following code: $fetch = mysql_query(SELECT * FROM calendar_events where event_status='booked'
All of a sudden the graph api only seems to be returning old posts.
All, I have the following class so to check to see if the form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.