TheInsider
Programmer
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:
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
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
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