On uploading pdf file via html form, content-type is set as text/html.

RESOLVED DUPLICATE of bug 373621

Status

()

defect
RESOLVED DUPLICATE of bug 373621
13 years ago
11 years ago

People

(Reporter: wuw, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

13 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.7) Gecko/20060911 Camino/1.0.3
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1) Gecko/20060918 Firefox/2.0 ID:2006091817

If I upload a pdf file via html form (<input type="file"/>), firefox sends its content-type as 'text/html' instead of 'application/pdf'.
Some web applications need to detect content-type of an uploaded file to check if it's an 'uploadable type' or not and this bug makes firefox unusable for those applications.

Reproducible: Always

Steps to Reproduce:
1. Create a php script.

<html><head><title></title></head>
<body>
<?php
if(!empty($_FILES['upfile']['name'])){
 echo "type = "        . $_FILES['upfile']['type'] . "<br>";
}
?>
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<input type="file" name="upfile" size="30">
<input type="submit" value="Upload">
</form>
</body>
</html>

2. Put the php script onto a server and load it.
3. Select a pdf file and press 'upload'. Content-type of the uploaded file will be displayed above the form.
Actual Results:  
'type = text/html' is displayed.

Expected Results:  
'type = application/pdf' is displayed.

For other file types such as png, gif and jpg, the content-type is correctly sent.
Reporter

Comment 1

13 years ago
Sorry, deleting the profile folder solved the problem.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
No need to be sorry, it was the code that messed up your profile, not you.
Resolution: INVALID → DUPLICATE
Duplicate of bug: 373621
You need to log in before you can comment on or make changes to this bug.