firefox uploads files with wrong mimetype

Bug #84880 reported by Sergio Callegari
34
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
High
firefox (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: firefox

Using firefox 2.0.0.1 on Ubuntu edgy.

If I upload a PDF file to some site using firefox, the receiver gets the file and an associated mimetype of application/binary rather than the correct application/pdf

(btw, note that konqueror uploads the pdf file with the correct mimetype).

I do not know if the above is a problem with edgy firefox or with upstream firefox, but I suspect the first.

The bug seems minor, but is in fact critical to those needing to upload conference papers or journal articles to publishers' web sites. In fact, the latter often refuse the file if the file does not appear to be PDF.

Revision history for this message
John Vivirito (gnomefreak) wrote :

Can you please provide us with a link to the PDF you are trying to save?

Changed in firefox:
assignee: nobody → mozillateam
status: Unconfirmed → Needs Info
Revision history for this message
Sergio Callegari (callegar) wrote : Re: [Bug 84880] Re: firefox uploads files with wrong mimetype

John Vivirito wrote:
> Can you please provide us with a link to the PDF you are trying to save?
>
> ** Changed in: firefox (Ubuntu)
> Assignee: (unassigned) => Mozilla Team
> Status: Unconfirmed => Needs Info
>
>
Actually, the problem exists for any PDF.

A couple of examples:

1) I am uploading a PDF paper to the www.epapers.org site, that manages
many conference submissions. The paper is rejected as the epapers site
thinks it is not PDF. If I do exactly the same operation with konqueror
it succeeds. Unfortunately here I cannot send you the PDF as it is a
still unpublished article.

2) I am uploading some PDF slides to our Dept. repository. Here the
site after receiving a file indicates the mime type of the received
file. If I submit with konqueror I get application/PDF, if I submit
with firefox, I don't. You can retreive any of these files at
http://sergio.callegari.googlepages.com/sseia-slides-2007.html.

Thanks,

Sergio

Alexander Sack (asac)
Changed in firefox:
importance: Undecided → Medium
David Farning (dfarning)
Changed in firefox:
assignee: mozillateam → mozilla-bugs
Revision history for this message
Rafa (rafae1-ramirez) wrote :

I confirm the issue of wrong MIME type being sent by firefox.

I'm currently setting up an intranet server for a research group. I have installed a
PDF manager (Librarian) and am currently trying to populate the database. Upon
the upload of the PDF files, I was getting an error message for incorrect MIME type
of the files. I hacked the php code to find out what the sent MIME type was, and got:
application/binary instead of the expected application/pdf.

This results in the file not being recognized by the program as a PDF, thus failure
to upload on the site.

At first I thought it was a problem with my php.ini configuration, and tweaked all
I could find on the matter without results. Then I came across this bug description
and actually confirmed that it is likely to be a firefox issue, and not an
apache2/php/pdf or whatnot.

The PDF files upload without the shadow of a problem using konqueror.

My server configuration is:
Ubuntu 7.04 Feisty Fawn i386
Apache2
PHP5

Librarian PDF manager (http://bioinformatics.org/librarian/)

My client:
Ubuntu 7.04 Feisty Fawn i386

The web browser:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20061201
Firefox/2.0.0.3 (Ubuntu-feisty)

All PDF files tested came up with the wrong MIME using firefox, none have yet
given me problems using konqueror.

For many required to submit their work by uploading PDF files on servers that
use MIME type control, this issue might be more than an annoyance.

Revision history for this message
Alexander Sack (asac) wrote :

do you still see this bug in up-to-date gutsy?

Revision history for this message
Sergio Callegari (callegar) wrote :

Unfortunately I am not using the gibbon yet.

if there is any way to check the up-to-date firefox from the feisty fawn, I would be pleased to do so.

Revision history for this message
Sebastian Schulze (bascht) wrote :

I am currently stuck with exactly the same problem, but using Firefox 3 / Ubuntu Hardy.

Uploading the File via Konqueror sends the mimetype "application/pdf".
Uploading exactly the same File via Firefox sends mimetype "application/x-application".

Could this probably be caused by a faulty extension?

Revision history for this message
Marlin Forbes (datashaman) wrote :

I am having the same probems, using FireFox 3/ Ubuntu Hardy. Only my PDFs are registered as text/html, instead of application/pdf.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0

Revision history for this message
WalterNicholls (walter-nic) wrote :

I have a possible solution - look at mimeTypes.rdf (see below)

I can confirm this problem, and while trying to find a fix, I came across this bug. There are also numerous logged on bugzilla.mozilla.org.

For the record: On Kubuntu Hardy, running under KDE3, Firefox version Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071717 Firefox/3.0.1. Plenty of extensions none of which I think are relevant.

Uploading PDF attachments to PHPList (phplist.com), they come through as application/binary. Konqueror does it fine. This is a serious problem, because phplist does not provide a way to change the mime type of an attachment (except a direct database edit, ouch). I can't just use Konqueror because that doesn't support FCKEditor for rich text editing.

"file" command reports PDF document, version 1.3, /etc/mime.types and all that look ok.

HOWEVER I had ported my firefox profile across from a Windows machine, I don't know what happened to that there, but in my profile directory, mimeTypes.rdf contained this gem:

      <RDF:Description RDF:about="urn:mimetype:application/binary"
                   NC:value="application/binary"
                   NC:editable="true"
                   NC:fileExtensions="pdf"
                   NC:description="Adobe Acrobat 7.0 Document">

I've edited this to instead say:

     <RDF:Description RDF:about="urn:mimetype:application/pdf"
                   NC:value="application/pdf"
                   NC:editable="true"
                   NC:fileExtensions="pdf"
                   NC:description="Adobe Acrobat Document">

Now file upload works.

Revision history for this message
Sergio Callegari (callegar) wrote :

WalterNicholls wrote:
> I have a possible solution - look at mimeTypes.rdf (see below)
>
> I can confirm this problem, and while trying to find a fix, I came
> across this bug. There are also numerous logged on bugzilla.mozilla.org.
>
> For the record: On Kubuntu Hardy, running under KDE3, Firefox version
> Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071717
> Firefox/3.0.1. Plenty of extensions none of which I think are relevant.
>
> Uploading PDF attachments to PHPList (phplist.com), they come through as
> application/binary. Konqueror does it fine. This is a serious problem,
> because phplist does not provide a way to change the mime type of an
> attachment (except a direct database edit, ouch). I can't just use
> Konqueror because that doesn't support FCKEditor for rich text editing.
>
> "file" command reports PDF document, version 1.3, /etc/mime.types and
> all that look ok.
>
> HOWEVER I had ported my firefox profile across from a Windows machine, I
> don't know what happened to that there, but in my profile directory,
> mimeTypes.rdf contained this gem:
>
> <RDF:Description RDF:about="urn:mimetype:application/binary"
> NC:value="application/binary"
> NC:editable="true"
> NC:fileExtensions="pdf"
> NC:description="Adobe Acrobat 7.0 Document">
>
> I've edited this to instead say:
>
> <RDF:Description RDF:about="urn:mimetype:application/pdf"
> NC:value="application/pdf"
> NC:editable="true"
> NC:fileExtensions="pdf"
> NC:description="Adobe Acrobat Document">
>
> Now file upload works.
>
>
... weird... I happen to have multiple entries for files with a pdf
extension. One of them says "application/x-pdf", onother one
"application/binary" and another one "application/octetstream".

So our problem might be the consequence of the usage of older firefox
version that for some reasons wrote wrong things (or things in the wrong
order) in the file.

I believe that we need to find out if a clean profile autogenerated by
the latest firefox shipped with Ubuntu creates the correct entry for pdf
files.
If it does, then we do not have a bug with ubuntu's latest firefox. We
have just something to put in the wishlist: namely a way to manage the
mimetype file when something goes wrong.

Conversely, if a clean profile autogenerated by the latest firefox
shipped with Ubuntu creates an uncorrect entry for pdf files (binary,
octetstream), then we have a bug.

Revision history for this message
John Vivirito (gnomefreak) wrote :

sergio.callegari wrote:
> WalterNicholls wrote:
>
>> I have a possible solution - look at mimeTypes.rdf (see below)
>>
>> I can confirm this problem, and while trying to find a fix, I came
>> across this bug. There are also numerous logged on bugzilla.mozilla.org.
>>
>> For the record: On Kubuntu Hardy, running under KDE3, Firefox version
>> Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071717
>> Firefox/3.0.1. Plenty of extensions none of which I think are relevant.
>>
>> Uploading PDF attachments to PHPList (phplist.com), they come through as
>> application/binary. Konqueror does it fine. This is a serious problem,
>> because phplist does not provide a way to change the mime type of an
>> attachment (except a direct database edit, ouch). I can't just use
>> Konqueror because that doesn't support FCKEditor for rich text editing.
>>
>> "file" command reports PDF document, version 1.3, /etc/mime.types and
>> all that look ok.
>>
>> HOWEVER I had ported my firefox profile across from a Windows machine, I
>> don't know what happened to that there, but in my profile directory,
>> mimeTypes.rdf contained this gem:
>>
>> <RDF:Description RDF:about="urn:mimetype:application/binary"
>> NC:value="application/binary"
>> NC:editable="true"
>> NC:fileExtensions="pdf"
>> NC:description="Adobe Acrobat 7.0 Document">
>>
>> I've edited this to instead say:
>>
>> <RDF:Description RDF:about="urn:mimetype:application/pdf"
>> NC:value="application/pdf"
>> NC:editable="true"
>> NC:fileExtensions="pdf"
>> NC:description="Adobe Acrobat Document">
>>
>> Now file upload works.
>>
>>
>>
> ... weird... I happen to have multiple entries for files with a pdf
> extension. One of them says "application/x-pdf", onother one
> "application/binary" and another one "application/octetstream".
>
> So our problem might be the consequence of the usage of older firefox
> version that for some reasons wrote wrong things (or things in the wrong
> order) in the file.
>
> I believe that we need to find out if a clean profile autogenerated by
> the latest firefox shipped with Ubuntu creates the correct entry for pdf
> files.
> If it does, then we do not have a bug with ubuntu's latest firefox. We
> have just something to put in the wishlist: namely a way to manage the
> mimetype file when something goes wrong.
>
> Conversely, if a clean profile autogenerated by the latest firefox
> shipped with Ubuntu creates an uncorrect entry for pdf files (binary,
> octetstream), then we have a bug.
>
>
Can you please list the links here for the upstream bugs that you think
fit this bug.

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

Changed in firefox:
assignee: mozilla-bugs → nobody
Revision history for this message
John Vivirito (gnomefreak) wrote :

sergio.callegari wrote:
> WalterNicholls wrote:
>
>> I have a possible solution - look at mimeTypes.rdf (see below)
>>
>> I can confirm this problem, and while trying to find a fix, I came
>> across this bug. There are also numerous logged on bugzilla.mozilla.org.
>>
>> For the record: On Kubuntu Hardy, running under KDE3, Firefox version
>> Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071717
>> Firefox/3.0.1. Plenty of extensions none of which I think are relevant.
>>
>> Uploading PDF attachments to PHPList (phplist.com), they come through as
>> application/binary. Konqueror does it fine. This is a serious problem,
>> because phplist does not provide a way to change the mime type of an
>> attachment (except a direct database edit, ouch). I can't just use
>> Konqueror because that doesn't support FCKEditor for rich text editing.
>>
>> "file" command reports PDF document, version 1.3, /etc/mime.types and
>> all that look ok.
>>
>> HOWEVER I had ported my firefox profile across from a Windows machine, I
>> don't know what happened to that there, but in my profile directory,
>> mimeTypes.rdf contained this gem:
>>
>> <RDF:Description RDF:about="urn:mimetype:application/binary"
>> NC:value="application/binary"
>> NC:editable="true"
>> NC:fileExtensions="pdf"
>> NC:description="Adobe Acrobat 7.0 Document">
>>
>> I've edited this to instead say:
>>
>> <RDF:Description RDF:about="urn:mimetype:application/pdf"
>> NC:value="application/pdf"
>> NC:editable="true"
>> NC:fileExtensions="pdf"
>> NC:description="Adobe Acrobat Document">
>>
>> Now file upload works.
>>
>>
>>
> ... weird... I happen to have multiple entries for files with a pdf
> extension. One of them says "application/x-pdf", onother one
> "application/binary" and another one "application/octetstream".
>
> So our problem might be the consequence of the usage of older firefox
> version that for some reasons wrote wrong things (or things in the wrong
> order) in the file.
>
> I believe that we need to find out if a clean profile autogenerated by
> the latest firefox shipped with Ubuntu creates the correct entry for pdf
> files.
> If it does, then we do not have a bug with ubuntu's latest firefox. We
> have just something to put in the wishlist: namely a way to manage the
> mimetype file when something goes wrong.
>
> Conversely, if a clean profile autogenerated by the latest firefox
> shipped with Ubuntu creates an uncorrect entry for pdf files (binary,
> octetstream), then we have a bug.
>
>
Is everyone using KDE? Can someone please confirm this happens on gnome
with firefox-gnome-support package installed?

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

Revision history for this message
Sarat (dsarat) wrote :

On XP and firefox 3.0.1 I receive mimetype for pdf as "text/csv" instead of "application/pdf". Can this be fixed easily?

Revision history for this message
Sarat (dsarat) wrote :

Sorry reported bug at the wrong place. Please Ignore. Wanted to post it to firefox forum

Revision history for this message
Louis Acresti (louis.acresti) wrote :

I don't like raising the dead, but I'm currently experiencing the same issue with Firefox 3.0.3 in Intrepid (8.10).

Namely, whenever I try uploading PDF files, they are detected as "application/octet-stream".

I'm running a somewhat custom installation though, could someone else confirm this behavior?

Here is some version from Firefox:Help->About:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3

Revision history for this message
Louis Acresti (louis.acresti) wrote :

Bug is also present with:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/8.10 (intrepid) Firefox/3.0.4

Revision history for this message
John Vivirito (gnomefreak) wrote :

Renamed package to firefox-3.0 due to 2.0 being obsolete.
Can you please let us know if this is still a problem with latest version of firefox in your repos? should be version 3.0.7

Revision history for this message
Nikolaus Rath (nikratio) wrote :

Yes, it is still an issue with 3.0.11 from Jaunty. For me, PDFs are uploaded with mime type application/x-download.

Changed in firefox-3.0 (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Michael JasonSmith (mpj17) wrote :

[Ubuntu 9.10, Firefox 3.5.8]

When I posted PDF files using Firefox the MIME-type was being set to text/html. However, I noticed in ~/.mozilla/firefox/xxx.default/mimeTypes.rdf the following entry

  <RDF:Description RDF:about="urn:mimetype:text/html"
                   NC:value="text/html"
                   NC:editable="true"
                   NC:description="">
    <NC:fileExtensions>pdf</NC:fileExtensions>
    <NC:fileExtensions>html</NC:fileExtensions>
    <NC:fileExtensions>htm</NC:fileExtensions>
    <NC:fileExtensions>shtml</NC:fileExtensions>
    <NC:handlerProp RDF:resource="urn:mimetype:handler:text/html"/>
  </RDF:Description>

After removing the line "<NC:fileExtensions>pdf</NC:fileExtensions>" and restarting Firefox I posted two PDF files, and the MIME-type was correctly set on both.

Revision history for this message
In , Timmhaas (timmhaas) wrote :

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

upload of pdf files fail cause of wrong mime-type. mime-type is send as "application/force-download" instead of "application/pdf".

Reproducible: Always

Steps to Reproduce:
1. Just use an simple php upload form and upload a pdf file. use PHP to get $_FILES['filename']['type'] to reproduce the invalid mime-type.
Actual Results:
application/force-download

Expected Results:
application/pdf

Revision history for this message
In , Remkodekeijzer (remkodekeijzer) wrote :

Just created a test php script:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Naamloos document</title>
</head>

<body>
<?php if(!isset($_FILES['bestand']))
{ ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="rdk" id="rdk">
  <p>
      <input type="file" name="bestand" id="bestand">
        </p>
          <p>
              <input type="submit" name="Verzenden" id="Verzenden" value="Verzenden">
                  <input type="reset" name="Wissen" id="Wissen" value="Herstellen">
                    </p>
                    </form>
                    <?php }
                    else
                    { echo $_FILES['bestand']['type']; }
                    ?>
                    </body>
                    </html>

This was the result of uploading a pdf file:
application/pdf

Revision history for this message
In , Timmhaas (timmhaas) wrote :

Just tried your script to verify that the problem still occurs. Same problem, sorry. I also checked IE, IE works fine for me. So needs to be a Firefox issue.

I am for sure it is caused by the new update. Are you on a Windows 7 64-Bit system by the way? Yesterday I worked the whole day at a order processing script (tried it a hundred times) before Firefox automatically updated. After the update, the problem occured.

P.S: I also tried different PDF files.

Revision history for this message
In , Remkodekeijzer (remkodekeijzer) wrote :

I'm running Firefox 3.6.3 on Windows Vista 32-bit
Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 - Build ID: 20100401080539

Revision history for this message
arno_b (arno.b) wrote :

On Lucid, firefox 3.6.3
I also suffer of the same issue with the following website with different pdf documents:
https://precisionconference.com

Here is the message given by the website:
We require that the submission be submitted in PDF format, so the 'MIME Type' of your submission must be " application/pdf application/x-pdf application/adobe application/x-unknown-application-pdf webmail/pdf". But the MIME Type sent by your browser was "application/binary".

I have no problem when using epiphany.

Revision history for this message
In , Florian-marchon (florian-marchon) wrote :

I have the same problem here. I'm using Firefox 3.6.3 on a Windows 7/32-bit system. My PDF-files are uploaded as text/html, while being uploaded as application/pdf on Internet Explorer 8. The PDF files are created using Adobe InDesign CS3 and edited using Adobe Acrobat 8 Professional.

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)

Revision history for this message
In , Zug-treno (zug-treno) wrote :

Duplicate of/related to bug 512982 comment 8 or bug 491982 -> Core bug 373621?

Revision history for this message
In , John Vivirito (gnomefreak) wrote :

This bug has also been reported in the Ubuntu bug tracker. So it happens on Linux as well as Windows.
Here is the Ubuntu bug report
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/84880

Revision history for this message
Roberto (roberto-colnaghi) wrote :

I'm quite sure this is not an Ubuntu bug, but a Firefox one. I have the same problem on a Mac, and a Windows machine. The workaround (not the solution, which should come from Mozilla) is the one pointed out in comments #8 and #19.

Changed in firefox-3.0 (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
arno_b (arno.b) wrote :

If the problem comes from firefox, find the corresponding bug report in the mozilla database and link this report to it, but do not close this report while the problem is not clearly identified.

Changed in firefox-3.0 (Ubuntu):
status: Invalid → New
Revision history for this message
John Vivirito (gnomefreak) wrote :

Changed source package to reflect new no versioning of Packages.
Marked as confirmed since a few people are seeing this bug.

If you can not find a bug in Mozilla database please file one with Mozilla and drop the link to the Mozilla bug here so we can track it.

affects: firefox-3.0 (Ubuntu) → firefox (Ubuntu)
Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Roberto (roberto-colnaghi) wrote :

Well, I'm sure this is not an Ubuntu bug, as I explained, so this is definitely clearly identified, but I have no time nor interest to search in the Mozilla database for a bug I already solved (sort of). I thought to be helpful, but if you don't understand it, then keep searching the solution where you can't find it, it's your problem.

Revision history for this message
arno_b (arno.b) wrote :

>Well, I'm sure this is not an Ubuntu bug
Maybe, as a lot of firefox bugs. If you close these reports people will open others again and again until these bugs are fixed by mozilla.
>I have no time nor interest to search in the Mozilla database
Ok, no problem someone will do it.
>I thought to be helpful
Of course you are since you triage ubuntu bugs ;)

Revision history for this message
John Vivirito (gnomefreak) wrote :

Roberto,
Can you please at least post what you did to "solved (sort of)"

Arno_b,
I'm guessing you found the bug upstream.
Thanks

Revision history for this message
Roberto (roberto-colnaghi) wrote :

John, I was simply referring to the workaround pointed out by our fellow testers in comments #8 and #19, which for me is better than nothing while waiting for Mozilla to fix (although I think this will not so simple, as it is a result of learning from sites which send wrong mime types, it's the old problem "extensions are not file types, but everybody (OSs, web browsers, web servers, ecc...) still insist using them as such" )

Arno_b, it was me who didn't understand your comment (and the way this database/community works), please accept my apologies.

Changed in firefox:
status: Unknown → New
Revision history for this message
John Vivirito (gnomefreak) wrote :

Thanks i totally missed those for some reason

Revision history for this message
In , Roland-bannier (roland-bannier) wrote :

Same as 547234 and as well on Mac OS X.

Changed in firefox:
importance: Unknown → High
Revision history for this message
Luis Galárraga (shamantobi) wrote :

Just as additional information, the bug is not present in Firefox 3.6.13 for Ubuntu (at least in 10.04) however it is still in the latest version of Firefox for Windows. I have 2 instances of Firefox, one running natively in Linux and the other with Wine and the second one reports "application/octet-stream" as the mime type for uploaded pdfs.

Revision history for this message
In , Bugzilla-tf (bugzilla-tf) wrote :

*** This bug has been marked as a duplicate of bug 373621 ***

Changed in firefox:
status: New → Invalid
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Can you please test this with a supported Firefox version? Does this error still occour? Thank you for your help!

Revision history for this message
Sergio Callegari (callegar) wrote :

Hi,

I am not anymore able to reproduce the issue. Yet, I cannot exactly say if this is because of firefox having been fixed or environmental conditions being changed...

1) Our dept repository has been completely renewed. The new one does not have the issue, but possibly it is now checking some magic in the files it receives to explicitly verify the file types.

2) E-papers does not have the issue anymore. But again I know it has been enhanced to workaround lots of browsers issues.

At this point, I think that it is anyway relatively safe to close the bug. If I see the issue again in a reproducible context, I'll open a new one.

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Thank you for your response! Please feel free to report any bug you encounter in Ubuntu!

Changed in firefox (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Sergio Callegari (callegar) wrote :

I'm reopening the bug for firefox 16.0.1.

I find it whenever trying to upload files to anagrafericerca.unibo.it. Unfortunately, this is a site with restricted access, so it cannot be used for debugging.

However, when trying to upload a pdf file with firefox, the site responds

 IL TIPO DEL FILE NON PUO' ESSERE ACCETTATO (application/octetstream)
I TIPI ACCETTABILI SONO:

    image/gif
    image/png
    image/x-png
    image/jpeg
    image/pjpeg
    image/pjpeg
    application/pdf
    text/html
    text/plain

which, as you probably imagine, means that the site is refusing the upload, because I'm trying to upload a file with mimetype application/octetstream while the site expexts only the formats listed below.

Changed in firefox (Ubuntu):
status: Invalid → New
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Then I will confirm this bug.

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Sergio Callegari (callegar) wrote :

Obviously, I double checked with other browsers that it is not the destination site to get confused.
Google chrome uploads files to anagrafericerca.unibo.it without any problem.

Revision history for this message
everflux (tklaunchpad) wrote :

This bug still affects firefox 40, I checked with the network tab, firefox is sending

Content-Disposition: form-data; name="file_0"; filename="xxxx.pdf"
Content-Type: application/empty

Revision history for this message
darko (darko) wrote : Re: [Bug 84880] Re: firefox uploads files with wrong mimetype

Ja same ženske želje, malo premisli...Ha ha

On 14. 08. 2015 21:14, everflux wrote:
> This bug still affects firefox 40, I checked with the network tab,
> firefox is sending
>
> Content-Disposition: form-data; name="file_0"; filename="xxxx.pdf"
> Content-Type: application/empty
>

Revision history for this message
IP Man (ipman98) wrote :

This bug is still affects firefox 39 and 40. So, I created a simple upload page (http://npd.hol.es/upload.php) to make sure it's fixed or not. This upload script will only allow to upload .rar (Winrar) / .srt (Subtitle) files.

But I get 'Invalid file format' error for every file I upload, even for supported formats. Also, I tried to upload using ubuntu default web browser, still get the same problem. Maybe this issue is in the ubuntu, not in firefox.

Revision history for this message
everflux (tklaunchpad) wrote :

I found a fix for the issue.
While I am not sure what is causing it (firefox or ubuntu) the problem is in the "mimeTypes.rdf". delete the file while firefox is not running and the problem is gone.

Whenever firefox downloads a file with a wrong mimetype it will record the broken mimetime along the file extension in that file and use that again when uploading files.

This is contagious, once a download is done with a bad type it is persisted and will be used for an upload, if the remote site keeps the mimetype from the upload and uses that when sending the file to the next user with firefox it will record it in that users mimetypes....

Revision history for this message
Paul White (paulw2u) wrote :

Upstream bug is a duplicate of #373621
Showing "RESOLVED FIXED" on 2016-07-29
Target release - Firefox 50
Closing this one by marking "Fix Released"

Changed in firefox (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.