You can also code the page to determine what file type it is by viewing the
extension and setting the ContentType appropriately.
I normall break down the filename to get the extension, then run a swtich on
that extension to set the content type:
If it wasn't one i was prepared for, i'll throw an exception, or write an
error message to the screen
switch (strFileExtension)
{
case ".pdf":
sContentType = "application/pdf";
break;
case ".ppt":
sContentType = "application/x-mspowerpoint";
break;
case ".tif":
sContentType = "image/tiff";
break;
case ".bmp":
sContentType = "image/bmp";
break;
case ".gif":
sContentType = "image/gif";
break;
case ".zip":
sContentType = "application/x-zip-compressed";
break;
case ".xls":
sContentType = "application/vnd.ms-excel";
break;
}
sdf
"Franck" <we**********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
The point that the user could insert in the database whatever file he
wants...
If he inserts a path to a file from which the extension is a strange
one... it's over.
Starting to think I'll forbide every files except Office ones and Pdf...