Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
fmahannah  
#1 Posted : Friday, January 17, 2014 12:03:53 PM(UTC)
fmahannah

Rank: Newbie

Groups: Member
Joined: 1/17/2014(UTC)
Posts: 5

I am testing the upload suite on a coldfusion site. So far I got everything working but have some issues to report. On the CFFILE upload tag I am specifying what file types to let Coldfusion upload. We have to do this since it is a public upload form and using file extensions is not secure enough.

In testing uploads of zip files using the uploader, it was constantly denied. Some debugging showed that when Aurigma uploaded zip files it was sending a content type of text/html instead of application/zip. To get it to upload and allow zip files I had to accept a file type of text/html which is also not safe.

Not sure if it makes a difference but I am also submitting form data along with the upload. Here is an example of the file type being sent:

Content-Disposition: form-data; name="File0_0"; filename="DogBedWorks.zip" Content-Type: text/html

Compared to a png file which uploads correctly:

Content-Disposition: form-data; name="File0_0"; filename="Category.png" Content-Type: image/png

We have to get this working correctly because allowing html files to be uploaded would be very risky for obvious reasons.

Thanks
Andrew  
#2 Posted : Friday, January 17, 2014 10:56:15 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
I have just tried to send a zip file from all our uploaders and looked the output content type using Fiddler and I have the following results:
  • Java - application/zip
  • ActiveX - application/zip
  • Flash - application/octet-stream
  • HTML5 - application/x-zip-compressed
I have two possible explanations:

1. The content type is modified on the server side for some reason.
2. The problem is reproduced with some specific settings and/or input file (not sure why it may happen though).

To check the idea #1, please use Fiddler or similar software to see what uploader sends out. This topic explains how you can do it.

To check the idea #2, please create a support ticket and send over your HTML/JavaScript with the uploader settings and an example of your file.
fmahannah  
#3 Posted : Saturday, January 18, 2014 5:20:46 AM(UTC)
fmahannah

Rank: Newbie

Groups: Member
Joined: 1/17/2014(UTC)
Posts: 5

Tested with fiddler and have the same issue:

Content-Disposition: form-data; name="File0_0"; filename="LOGOS.zip"
Content-Type: text/html

Not sure what it means but this is with firefox 26 on windows 8.1 pro.

If I test with Explorer I get the correct content type as below:

Content-Disposition: form-data; name="File0_0"; filename="DogTravelWorks.zip"
Content-Type: application/x-zip-compressed

Andrew  
#4 Posted : Sunday, January 19, 2014 9:34:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Is it HTML5 uploader?

I suspect it should use a MIME type from the registry. Try to run regedit and find this entry:

HKEY_LOCAL_MACHINE\Software\Classes\.zip

It should contain a key called Content Type. Is it "application/x-zip-compressed"?
fmahannah  
#5 Posted : Monday, January 20, 2014 4:40:27 AM(UTC)
fmahannah

Rank: Newbie

Groups: Member
Joined: 1/17/2014(UTC)
Posts: 5

The mime type in the registry is correct. The issue occurs in both html5 uploader and the flash uploader in Firefox.
Andrew  
#6 Posted : Monday, January 20, 2014 6:28:18 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Did you try Chrome?
fmahannah  
#7 Posted : Tuesday, January 21, 2014 5:08:54 AM(UTC)
fmahannah

Rank: Newbie

Groups: Member
Joined: 1/17/2014(UTC)
Posts: 5

With Chrome it works fine, uses the html5 uploader and uploads a zip OK
Andrew  
#8 Posted : Tuesday, January 21, 2014 6:16:30 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
I have googled a little big and found a discussion of a similar problem, but with PDF files on Mozilla's bug tracker:

https://bugzilla.mozilla...g/show_bug.cgi?id=373621

As far as I understand, if you download a file of a particular type and assign an application to such files, it saves this information along with a mime type returned by a server in a file in Mozilla profile called mimeTypes.rdf. After that FF uses the mime type stored in mimeTypes.rdf to map from a file name to a mime type.

If you ever downloaded a .zip file and a server returned bad file type (like "text\html"), Mozilla may write it to mimeTypes.rdf and further it will send this mime type during the upload.

If it is a case, you can fix it either by removing this file (FF should create an empty .rdf file reset to defaults) or resetting Firefox as described here:

https://support.mozilla....easily-fix-most-problems

Disclaimer: I did not try it myself, so you should do it on your own risk. However I would appreciate if you try it and post here about results.

If it helps, it means that this behavior does not have something to do with the uploader, but it is a result of a FF bug (or to tell more precisely, very special way of FF to determine a mime type by relying on mime types provided by third party servers rather than system settings).
fmahannah  
#9 Posted : Wednesday, January 22, 2014 4:33:55 AM(UTC)
fmahannah

Rank: Newbie

Groups: Member
Joined: 1/17/2014(UTC)
Posts: 5

That fixed it! When I looked on the application tab of firefox options, there were several correct entries for zip files and one incorrect one saying they were type text/html. I was not able to delete it in options so I shut down firefox, renamed the mimeTypes.rdf file, and then restarted Firefox. After that zip uploads worked normally using both the flash and the html5 uploaders.

Thanks again. Very strange that Firefox would use it's mime type list to identify outgoing files when the list is supposed to apply to incoming files.
Andrew  
#10 Posted : Wednesday, January 22, 2014 11:48:24 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
It seemed strange to me as well. Hopefully Mozilla will eventually fix it.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.