Status: Unconfirmed Owner: all-bugs-t...@chromium.org Labels: Type-Bug Pri-2 OS-All Area-Misc
New issue 6800 by yangliu5: Chrome doesn't set Content-Type for file upload when the file extension is not recognized. http://code.google.com/p/chromium/issues/detail?id=6800 Chrome Version : 1.0.154.42 Other browsers tested: Firefox 3: OK IE 7: OK What steps will reproduce the problem? 1. Write a simple file upload form like this one: <html> <body> <form method="post" action="file_upload" enctype="multipart/form-data"> <input type="file" name="thefile"> <input type="submit" value="submit"> </form> </body> </html> 2. Open the test page in chrome 3. choose a file with a weird extension. In my case the extension was ".aes". Submit the form. 4. Use some tool to monitor the http request and you will notice that Content-Type is not set for thefile. (In my case I wrote a webwork-based web application as the server and dumped the request there.) For the same test, Firefox 3 uses "application/octet-stream" as the Contet- Type for the file and IE7 uses "application/x-zip-compressed" 5. Re-do the test with a well-known file extension, such as ".xml". Chrome properly detected the content type as "text/xml" and set the field in the request. What is the expected result? There should be a Content-Type assigned to the uploaded file. Even if the file extension is not recognized, a default value such as "application/octet-stream" might be good enough, like what Firefox does. What happens instead? The Content-Type field for the uploaded file is missing. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ Automated mail from issue updates at http://crbug.com/ Subscription options: http://groups.google.com/group/chromium-bugs -~----------~----~----~----~------~----~------~--~---