Hi,
I'm using SA-Fileup to upload files and I only want to only allow certain file types. TXT in my case.
I got this code straight from soft artisans but it does not work. It won't let me upload any file, including txt, which is should allow. Please any ideas
//code
Set upl = Server.CreateObject("SoftArtisans.FileUp"
filename = Mid(Upl.UserFilename,InstrRev
(Upl.UserFilename,"\"
+1)
FCONT = upl.ContentType
Response.Write FCONT
FCONT = Mid(FCont, InstrRev(FCont, "/"
+ 1)
Select Case LCase(FCONT)
Case "txt"
upl.SaveAs "d:\data\fiftyon\emailer\uploadfiles\" & filename & ""
Response.Write "<P>" & FName & " has been saved." & FCONT
Case else
upl.delete
Response.Write "<font face=verdana size=2>The file you tried to upload is not a text file. This program will only work with text files"
%>
<br><br><a href="newsletter.asp"><font size=3>Re-try with a text file</font></a>
<%
Response.End
End Select
I'm using SA-Fileup to upload files and I only want to only allow certain file types. TXT in my case.
I got this code straight from soft artisans but it does not work. It won't let me upload any file, including txt, which is should allow. Please any ideas
//code
Set upl = Server.CreateObject("SoftArtisans.FileUp"
filename = Mid(Upl.UserFilename,InstrRev
(Upl.UserFilename,"\"
FCONT = upl.ContentType
Response.Write FCONT
FCONT = Mid(FCont, InstrRev(FCont, "/"
Select Case LCase(FCONT)
Case "txt"
upl.SaveAs "d:\data\fiftyon\emailer\uploadfiles\" & filename & ""
Response.Write "<P>" & FName & " has been saved." & FCONT
Case else
upl.delete
Response.Write "<font face=verdana size=2>The file you tried to upload is not a text file. This program will only work with text files"
%>
<br><br><a href="newsletter.asp"><font size=3>Re-try with a text file</font></a>
<%
Response.End
End Select