Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Are MIME / ContentTypes reliable?

Status
Not open for further replies.

TheInsider

Programmer
Jul 17, 2000
796
CA
Hello,
I am developing a website on Windows 2000 Server (IIS 5) and I am currently using the IE 5 browser to test the pages. My website requires file uploads, so I am using SoftArtisans FileUp v3.54 (I believe).

I want to limit the files that can be uploaded to zip format only. The thing that I am unsure of is:

When I upload a zipped file the ContentType property of FileUp returns "application/x-zip-compressed", however I have seen the zip MIME type listed on the web several times as "application/zip". I have also seen it listed as "application/x-zip".

I am worried that if I use the following code:
Code:
If objFileUp.ContentType = "application/x-zip-compressed" Then
   [Continue...]
Else
   [Abort...]
End If
The abort code will be called if the user sends "application/zip".

Ok, so I could simply check the file extension for .zip, however the users can also download these files... so while checking the file extension takes care of one problem, what ContentType do I send the client when they want to download the file? Will all browsers understand "application/x-zip-compressed" ?

So to summarize: what is the best way to handle MIME ContentTypes to limit uploads to zip only and what MIME ContentType do I send back to the client's browser when they want to download the file?

Thanks,
TheInsider
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top