I have a JSP page with a file selector. User selects a document on this page and submits it to the server which then does some processing with the document.
Below is a code snippet -
<form name="import_form" id="import_form" action='<%= request.getParameter("bpurl") %>/http/upload_doc' method="post" enctype="multipart/form-data">
<input type="file" class="file" name="doc_import" id="doc_import" onchange="displayDocLabel(this);"/>
when the form is submitted, I have traced this request through Fiddler and noticed that for doc, docx, xls etc the content-type is getting set as application/octet-stream
Content-Disposition: form-data; name="doc_import"; filename="Troubleshooting.doc"
However for other types, like pdf, txt, png etc it is being set to the correct content-type. Example,
Content-Disposition: form-data; name="doc_import"; filename="Dok_5.pdf"
For .doc files, I would have expected it to be set as application/msword but that is not the case. Can someone please help me understand why this is happening and what do I need to do to correct this.
Thanks in anticipation.