Persits.Upload.1 错误 '800a0009' Index out of range. 请教各位这个错误问题
Persits.Upload.1 错误 '800a0009' Index out of range.
出现问题的原因是:我如果上传有图片的话,那能成功的,但是如果我不上传图片的,就会出现上面的错误!
还有就是如何判断是他是否有上传图片!
[bold]我的代码如下:[/bold]
Set Upload = Server.CreateObject("Persits.Upload")
Upload.OverwriteFiles = True
Upload.SetMaxSize 101000, True
Upload.Save
Set Image_file=Upload.Files(1)
Select Case Image_file.Ext
Case ".jpg"
FileExt=".jpg"
Case ".gif"
FileExt=".gif"
Case ".jpeg"
FileExt=".jpeg"
Case ".bmp"
FileExt=".bmp"
Case Else
Response.write "请上传.gif,.bmp,.jpg图片!"
Response.End
End Select
IF Trim(FileExt)="" Then
Response.Write "<script>alert('请上传.gif,.bmp,.jpg图片!');history.go(-1);</script>"
Response.End()
End IF
Image_file.SaveAs FilePath&FileName&FileExt'保存地址有文件名
DoctorPhoto="/UploadFiles/"&sj&"/"&FileName&FileExt'图片路径