File Upload: *.CSV

K

King

When I upload CSV files to my development computer from my development
computer the content type is displayed as Output 1. However, if I
upload from another computer on my network using the EXACT same file,
I get Output 2. Can anyone tell me why that is? I just want to check
to see if the file being uploaded is of type CSV. I want this to work
from any computer on the network.


===========Code Snippet===========
HttpPostedFile file = UploadBox.PostedFile;
Response.Write(file.ContentType);
================================


============Output 1==============
application/vnd.ms-excel
================================


============Output 2==============
application/vnd.ms-excel
================================


Thank you,
King
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

King said:
When I upload CSV files to my development computer from my development
computer the content type is displayed as Output 1. However, if I
upload from another computer on my network using the EXACT same file,
I get Output 2. Can anyone tell me why that is? I just want to check
to see if the file being uploaded is of type CSV. I want this to work
from any computer on the network.


===========Code Snippet===========
HttpPostedFile file = UploadBox.PostedFile;
Response.Write(file.ContentType);
================================


============Output 1==============
application/vnd.ms-excel
================================


============Output 2==============
application/vnd.ms-excel
================================

They look the same to me, but even if they are different (one read like
text/plaintext) it does not matter, the answer you get is dependand of
either the configuration of IIS or the default program that is registered in
the system to handle a file with that extension.


Why are you so worried about it?
 
B

Bram

Ehm, I'm not sure I see what's the problem. Both outputs look
identical to me. Isn't that what's supposed to happen?

Regards,
Bram
 

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

Top