Closed Bug 354464 Opened 18 years ago Closed 18 years ago

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

Categories

(Firefox :: File Handling, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 373621

People

(Reporter: wuw, Unassigned)

Details

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.
Sorry, deleting the profile folder solved the problem.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
No need to be sorry, it was the code that messed up your profile, not you.
Resolution: INVALID → DUPLICATE
You need to log in before you can comment on or make changes to this bug.