Page 1 of 1

Invalid file type! when uploading files to downloads

Posted: Mon Jun 17, 2013 5:48 pm
by mapperman
My site was recently upgraded to 1.5.5.1
When trying to upload files to the catalog/downloads area i get the error "Invalid File Type!
Checking here on the forums I tried adding the file extensions to the system/server tab and mime section, I have tried for example .doc and .pdf as well as doc and pdf and nothing seems to work.
If anyone can help I will appreciate it.

Re: Invalid file type! when uploading files to downloads

Posted: Mon Jun 17, 2013 6:46 pm
by inactiveaccount9912
Each file extension must be added on its own line:

Code: Select all

zip
doc
pdf
etc
If that still gives you trouble check the mime type and see if types

Code: Select all

application/msword
application/pdf
are in the list, if not, add them.

Re: Invalid file type! when uploading files to downloads

Posted: Mon Jun 17, 2013 11:44 pm
by mapperman
SOLVED!, thanks this works perfectly all is well.

Re: Invalid file type! when uploading files to downloads

Posted: Wed Jul 10, 2013 10:35 pm
by mandamexico
I cannot upload a compressed zipped folder with files in it.

I added:
application/zip
application/.zip
folder/zip
folder/.zip


am I missing anything? please help me :(

Re: Invalid file type! when uploading files to downloads

Posted: Thu Jul 11, 2013 10:03 pm
by MarketInSG

Code: Select all

.rar    application/x-rar-compressed, application/octet-stream
.zip    application/zip, application/octet-stream
http://stackoverflow.com/questions/6977 ... -mime-type

Re: Invalid file type! when uploading files to downloads

Posted: Wed Sep 11, 2013 1:52 am
by Mangostine
Hello Florinsith,

I did the same of Mapperman. In system > server i added :

zip
pdf
rar

And in Mime :

application/zip
application/pdf
application/x-rar-compressed


So when i want to add a file pdf in catalog > downloads, for zip it works good but for pdf it doesn't work.

Do you no why ?

Thanks

Re: Invalid file type! when uploading files to downloads

Posted: Fri Oct 18, 2013 11:13 am
by butte

Re: Invalid file type! when uploading files to downloads

Posted: Sun Oct 20, 2013 12:45 am
by spidermycron
Hello,
i have problem to upload zip file

how do i add in minmi type ?

from post above i read it alot and i don't know what to do


thanks for help

Re: Invalid file type! when uploading files to downloads

Posted: Sun Oct 20, 2013 4:00 am
by butte
In admin System / Settings / Store / Edit at file types put in box .zip and at mime types put in box application/zip ...

Uploadable extensions, for example, one per line:

zip
doc
pdf

Corresponding mimes, for example, one per line:

application/zip
application/msword
application/pdf

Re: Invalid file type! when uploading files to downloads

Posted: Wed Nov 13, 2013 9:38 pm
by JNeuhoff
I am unable to upload a zip-file, even though in my Opencart 1.5.6 system settings, both the 'zip' extension and the mime types 'application/zip' and 'application/octet-stream' are included. When I debugged it, I noticed that the server always sees the this->request->files['file']['type'] as 'text/html'.

This makes me think the the 'ajaxupload.js' script used for the file upload might be buggy!

Re: Invalid file type! when uploading files to downloads

Posted: Thu Nov 14, 2013 2:23 am
by butte
Whether ajaxupload.js and any others that might interact with it differ from 1.5.5.1 in 1.5.6.0 may fall out of a quick dir comparison. I don't recall a prior machine view of binary zip as ascii text.

Re: Invalid file type! when uploading files to downloads

Posted: Thu Nov 14, 2013 5:37 am
by JNeuhoff
butte wrote:Whether ajaxupload.js and any others that might interact with it differ from 1.5.5.1 in 1.5.6.0 may fall out of a quick dir comparison. I don't recall a prior machine view of binary zip as ascii text.
I actually narrowed it down: It was Firefox 25.0 which set the mime type 'text/html' for a zip-file, and 'text/html' wasn't listed in my Opencart's system settings amongst its supported mime types. Not sure how Firefox got this unusual mime type association, see attached screenshot!

Re: Invalid file type! when uploading files to downloads

Posted: Thu Nov 14, 2013 7:55 am
by butte
Well, that's comforting, it's not OC. The FF upgrading routine tends at intervals to reset even basic settings, and that as I recall is a new mistake in FF. It's probably worth bringing up the config in the address bar to see what else it might have done, throughout. I've already chosen to skip "24", so I'll also skip "25" (thanks for finding that).

Re: Invalid file type! when uploading files to downloads

Posted: Fri Jan 24, 2014 7:22 pm
by paradoxx
JNeuhoff wrote:
butte wrote:Whether ajaxupload.js and any others that might interact with it differ from 1.5.5.1 in 1.5.6.0 may fall out of a quick dir comparison. I don't recall a prior machine view of binary zip as ascii text.
I actually narrowed it down: It was Firefox 25.0 which set the mime type 'text/html' for a zip-file, and 'text/html' wasn't listed in my Opencart's system settings amongst its supported mime types. Not sure how Firefox got this unusual mime type association, see attached screenshot!
This is wonderful!!! I messed up with editing the php files, commenting, editing, changing file permissions you have no idea and I would never thought that this Scheiß Firefox was the responsible of this. This is the solution. Thank you very much for sharing it.

VG.

Re: Invalid file type! when uploading files to downloads

Posted: Sat Jan 25, 2014 2:15 am
by butte
As I noted above, 23 does not do that and after already skipping 24 I also skipped 25. Ditto as need be onward until I see no glitches that are overall minor but overall unacceptable.