473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Uploaded Filetype Discrepency

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

Jul 18 '07 #1
1 1248
King wrote:
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.
Jul 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mat | last post by:
Hi, I have a system that uploads images as BLOBs in a database. I also have a function that I use to resize uploaded images before saving as files. I would like to combine these two by resising...
0
by: Mark | last post by:
Hi all, I want to be able to resize an image that a user has uploaded. I have the image upload working as well as the image resize. When I go to delete the original uploaded file (I want to...
18
by: Keith Brown | last post by:
I have an application that allows embedded storage of ANY chosen file in an OLE field. The file could have been dragged-and-dropped into the field or it might have been selected and imported...
5
by: IkBenHet | last post by:
Hello, I use this script to upload image files to a folder on a IIS6 server: ******************* START UPLOAD.ASPX FILE ********************** <%@ Page Language="VB" Debug="true" %>
7
by: kids_pro | last post by:
I found FileInfo expose alot of methods & properties. However I can't get FileType from FileInfo I can only get File extension. How can I get fileType any build-in library allow me to do that?...
4
by: riteshjain82 | last post by:
Hi, Please go through this: I am having a file (default.asp) on which i am taking many details from a user before mailing it to someone. I have also provided the user with a facility of...
6
by: Kimmo Laine | last post by:
Running IIS 6 on Windows 2003 server. After an update to the most recent version of php 5.1.2, for some reacon a function handling uploaded files using is_file stopped working. is_file failed...
0
by: Stuman | last post by:
>From a previous message that I am unable to reply to, here it is again From: Steve Podradchik - view profile Date: Wed, Mar 5 2003 4:29 am Email: "Steve Podradchik"...
2
aestheticmind
by: aestheticmind | last post by:
Hello, How do you evaluate multiple values in a single Variable? Can someone give me a hand on how to set $filter so that it will evaluate all of the values. Right now it will only eval the first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.