Upload Script Damn Strange
hey thereI use a upload script and it has always worked fine how now I have added a little extra to it so it checks if the file being uploaded is jpg or gif
here it is
<%
Set Upload = Server.CreateObject(\"Persits.Upload.1\")
Upload.OverwriteFiles = True
Upload.SetMaxSize 1048576
Count = Upload.Save(\"D:\\home\\guzziedk\\www\\upload\\tmp\\\")
uploadpath = upload.form(\"uploadpath\")
For Each File in Upload.Files
File.Copy uploadpath & File.ExtractFileName
File.Delete
next
For Each File in Upload.Files
If File.ImageType <> \"gif\" and File.ImageType <> \"jpg\" Then
Response.redirect (\"upload_upload_pic_news.asp?id=\" & Id & \"&error=0\")
End If
If File.ImageWidth > 800 Then
Response.redirect (\"upload_upload_pic_news.asp?id=\" & Id & \"&error=0\")
End If
If File.ImageHeight > 600 Then
Response.redirect (\"upload_upload_pic_news.asp?id=\" & Id & \"&error=0\")
End If
pic = File.ExtractFileName
Next
%>
the problem is that it redirects everytime it checks the File.ImageType
And the file are gif and jpg that im uploading ??
Any ideas
Guzzie
