C
CVerma
I'm using an html input control
(System.web.UI.HTMLControls.HTMLInputFile) to upload files such as
msword, excel, jpg, and pdf.
I have the encType property set in the form:
encType="multipart/form-data"
<INPUT id="UploadFile" type="file" name="UploadFile" runat="server">
Private Sub btnUploadFile_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUploadFile.Click
If UploadFile.PostedFile.FileName <> "" Then
Dim imgdatastream As Stream =
UploadFile.PostedFile.InputStream
Dim imgdatalen As Integer =
UploadFile.PostedFile.ContentLength
Dim imgtype As String = UploadFile.PostedFile.ContentType
---
--
---
more code to add the file to a record and store in SQL server
End If
End Sub
Problem: I have 3 different servers on which the above function works
fine. But on one server which is behind firewall and has certificate
installed on it, the excel and word files return ContentType as
"application/octet-stream". instead of "application/msword" or
"application/vnd.ms-excel"
The uploaded files are saved as image in SQL server 2000.
Since the content type is "application/octet-stream", while
downloading the files using httphandler funtionality, the files get
downloaded as
"test.xls.aspx"
"test.doc.aspx"
If I save the above files as "test.xls", the files are in right
format. But from users point of view, it should save as test.xls.xls
in the first place.
AND on the other servers, same files have content type as
"application/vnd.ms-excel", so while downloading they download as
"test.xls.xls"
"test.doc.doc"
Does anyone know what could be the reason for the files having the
contenttype as "application/octet-stream".
Thanks,
Chanda.
(System.web.UI.HTMLControls.HTMLInputFile) to upload files such as
msword, excel, jpg, and pdf.
I have the encType property set in the form:
encType="multipart/form-data"
<INPUT id="UploadFile" type="file" name="UploadFile" runat="server">
Private Sub btnUploadFile_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnUploadFile.Click
If UploadFile.PostedFile.FileName <> "" Then
Dim imgdatastream As Stream =
UploadFile.PostedFile.InputStream
Dim imgdatalen As Integer =
UploadFile.PostedFile.ContentLength
Dim imgtype As String = UploadFile.PostedFile.ContentType
---
--
---
more code to add the file to a record and store in SQL server
End If
End Sub
Problem: I have 3 different servers on which the above function works
fine. But on one server which is behind firewall and has certificate
installed on it, the excel and word files return ContentType as
"application/octet-stream". instead of "application/msword" or
"application/vnd.ms-excel"
The uploaded files are saved as image in SQL server 2000.
Since the content type is "application/octet-stream", while
downloading the files using httphandler funtionality, the files get
downloaded as
"test.xls.aspx"
"test.doc.aspx"
If I save the above files as "test.xls", the files are in right
format. But from users point of view, it should save as test.xls.xls
in the first place.
AND on the other servers, same files have content type as
"application/vnd.ms-excel", so while downloading they download as
"test.xls.xls"
"test.doc.doc"
Does anyone know what could be the reason for the files having the
contenttype as "application/octet-stream".
Thanks,
Chanda.