Uploaded Filetype Discrepency

K

King

Hello,

I want to check to see if the file I am uploading is of type CSV. I
can upload and access the contents of the file just fine. Here is a
code snippet doing the checking:

HttpPostedFile file = UploadBox.PostedFile;

if (file.ContentType.Equals("application/vnd.excel"))
{
do stuff;
}

This works fine when I am uploading from my development computer to my
development computer. I used,

Response.Write(file.ContentType);

to view the ContentType. When uploading from my development computer I
received the following output:

application/vnd.excel

However, when I uploaded from another computer the EXACT same file, I
received the following output:

application/octet-stream

Why is it doing this? I am sure that my file type CSV.

Thank you,
King
 
E

Ed Courtenay

King said:
Hello,

I want to check to see if the file I am uploading is of type CSV. I
can upload and access the contents of the file just fine. Here is a
code snippet doing the checking:

HttpPostedFile file = UploadBox.PostedFile;

if (file.ContentType.Equals("application/vnd.excel"))
{
do stuff;
}

This works fine when I am uploading from my development computer to my
development computer. I used,

Response.Write(file.ContentType);

to view the ContentType. When uploading from my development computer I
received the following output:

application/vnd.excel

However, when I uploaded from another computer the EXACT same file, I
received the following output:

application/octet-stream

Why is it doing this? I am sure that my file type CSV.

Thank you,
King

You've already asked the exact same question in this Newsgroup, and been
given the answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

File Upload: *.CSV 1
File Upload: *.CSV 3
Content Type not recongnized 4
FileSystemWatcher 4
FTP server 1
ftp uploads 1
File Not Released After Thumbnail Created 2
Worker thread passing back messages 6

Top