Uploaded Filetype Discrepency

  • Thread starter Thread starter King
  • Start date Start date
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
 
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.
 
Back
Top