I tried uploading any image file or zip file and i get the below error:
The selected file trinity2k2.jpg cannot not be uploaded. Only files with the following extensions are allowed: image/png, image/gif, image/jpeg, application/zip, application/x-zip, application/x-zip-compressed, application/x-compress, application/x-compressed.
The selected file Cruise.zip cannot not be uploaded. Only files with the following extensions are allowed: image/png, image/gif, image/jpeg, application/zip, application/x-zip, application/x-zip-compressed, application/x-compress, application/x-compressed.
I have .zip compiled into php:
Zip enabled
Extension Version $Id: php_zip.c 305848 2010-11-30 11:04:06Z pajoye $
Zip version 1.8.11
Libzip version 0.9.0
any ideas on how to fix this?
Comments
Comment #1
DrunkMunki commentedStill no luck.
using PHP 5.2.17 (i know its old but some custom modules were design for this version only)
i tried using the -dev version but the issue still persists.
anyone else get this issue straight out the box?
Comment #2
mauro72 commentedI have the same problem, in my case it seems to be something related with transliteration module, when transliteration checkboxes are unchecked(in /admin/settings/file-system) the images work. I'm testing in D6.
Any ideas?
Comment #3
DrunkMunki commentedi would just like to confirm i have transliteration installed too, investigating to see what i can do to fix it.
My version of transliteration is 6.x-3.0-rc1
Comment #4
DrunkMunki commentedok i applied the patch for transliteration at http://drupal.org/node/1243974
-no go
removed transliteration completely and from the db
-no go
still not having any luck.
ok i just removed and uninstalled all modules to the site except this module and some core modules... stil didnt work.. has to do with the module itself.
Comment #5
barteque commentedAny solutions?
I'm having the same problem
no matter what version of imagefile_zip I use
Comment #6
DrunkMunki commentedi've had no luck in solving this, was thinking it may have something to do with the server MIME types but the files specified are listed.
and no help form the author....
Comment #7
mikeytown2 commentedWhat version of CCK are you using? I developed this module for CCK 3.x and it sorta works with 2.x but it's not fully tested. The function that is throwing that error is in imagefield_zip_file_save_upload() on line #1120. One of the validators is throwing that error; if you can track down the bad one that would make solving this go a lot quicker :)
Comment #8
DrunkMunki commentedi upgraded to 3.0-dev and still same results.
log file isnt showing any errors besides the one already indicated.
Comment #9
mikeytown2 commentedThat error message doesn't exist in this module. I need you to tell me what functions are being called on line 1101
foreach ($validators as $function => $args) {Comment #10
DrunkMunki commentedline 1101++
Comment #11
daluxz commentedI'm having the same problem.
The errors I get are similar to the errors in post #1.
I tried to dpm $validators on line 1101, but the script doesn't seem to get there when you select an image to be uploaded.
It looks to me like DrunkMunki had the same error as I did
(only it was worded a bit different, that's why post #9 suggests this error is coming from someplace else). The error I had came from imagefield_zip_save_and_extract_upload, line 341.The error seems to come from filefield.js line 18.
To me it seems like the validation is doing something wrong. The error says that only certain FILE EXTENSIONS are allowed, but the list of allowed items shows MIME-types...
It looks like the validation tries to validate the file extensions against the MIME-types, which won't work.
When you look at the form, $form[NAME OF YOUR IMAGEFIELD_zip][NAME OF YOUR IMAGEFIELD_upload]['#attributes']['accept'] contains mime-types (image/png, image/gif, image/jpeg, application/zip, application/x-zip, application/x-zip-compressed, application/x-compress, application/x-compressed). If you change this to 'jpg, jpeg, gif, png, zip', the form validates and you can happily upload files.
Comment #12
daluxz commentedAfter some further investigation it looks like the Filefield module uses the 'accept'-attribute for filefield form-elements to validate the files that are going to be uploaded.
This validation function (filefield.js line 18) expects file-extensions, while in imagefield_zip_build_upload_form() the 'accept'-attribute is filled with mime-types. I'm not sure if this is done on purpose, but I think this should be changed so the 'accept'-attribute contains only file-extensions.
Comment #13
mikeytown2 commentedWhat version of filefield are you using? I'm using 6.x-3.10
Comment #14
daluxz commentedI'm using 6.x-3.7
I will try to update to 6.x-3.10 and see how that works out.
Comment #15
daluxz commentedUpdating Filefield to 6.x-3.10 fixed the issue for me.
It looks like filefield now uses a Drupal.setting to validate against, instead of the accept-attribute.
Maybe you can add a note to the project page telling what version of Filefield to use?
Comment #16
mikeytown2 commented3.7 is almost 2 years old! I've updated the project page saying this requires that version or newer. Changing this status to support request and fixed.