Excluding file types and limiting filesize in classic asp upload script
Hi all,
I have a fileupload function which works fine. Consists of a page for selection of the file and a page for upload. Now I want to limit the filetypes and also the size of the files that are being uploaded. I guess the latter is a question of removing ' from oFileUp.Maxbytes = 300? But doing so has no effect - files are uploaded even if I set it to 0 AND remove the '. The Code for upload is below, suggestions much appreciated!
<%Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")oFileUp.Path = "path to file on server..."'oFileUp.CreateNewFile = TrueoFileUp.OverWriteFiles = True'oFileUp.Maxbytes = 300If Not oFileUp.Form("file1").IsEmpty ThenoFileUp.Form("file1").SavestrFileName = oFileUp.ShortFileNamefilnavn = strFilenameIf Err.Number <> 0 ThenResponse.Write "<B>Error description:</B> " & Err.DescriptionElseResponse.Write "<h4><center><br><b>Your " & filnavn & " was recieved.<b></center>"End IfElseResponse.Write "Error! No file designated for upload!"End IfSet oFileUp = Nothing%>