Fejl i ASPimage upload
hvad er der galt med denne aspimage upload?den skal lave en fil til 400x bred, og samtidig lave en thumbnail af den?
jeg får denne fejl :
Microsoft VBScript runtime error '800a000b'
Division by zero
/test/upload.asp, line 23
------
<%
if request("upload")="ja" then
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage Server.MapPath("/test/images/Pictures/" & strFilename)
intWidth = 400
If (Image.MaxX > intWidth) OR (Image.MaxY > intWidth) Then
If(Image.MaxX > Image.MaxY) Then
intRatio = ((intWidth * 100) / Image.MaxX)
intNewY = CInt(Image.MaxY * (intRatio / 100))
Image.ResizeR intWidth, intNewY
Image.ImageFormat = 1
Else
intRatio = ((intWidth * 100) / Image.MaxY)
intNewX = CInt(Image.MaxX * (intRatio / 100))
Image.ResizeR intNewX, intWidth
Image.ImageFormat = 1
End if
End If
Image.FileName = Server.MapPath("/test/images/Pictures/" & strFilename)
Image.SaveImage
Image.LoadImage Server.MapPath("/test/images/Pictures/" & strFilename)
intRatio = ((40 * 100) / Image.MaxX)
intNewY = CInt(Image.MaxY * (intRatio / 100))
Image.ResizeR 40, intNewY
Image.ImageFormat = 1
Image.FileName = Server.MapPath("/test/images/Pictures/thumbnails/" & strFilename)
Image.SaveImage
Set Image = Nothing
else
%>
<form method="POST" enctype="multipart/form-data" name="upload" action="upload.asp?upload=ja">
<p><input type="file" name="image" size="20"></p>
<p><input type="submit" value="Send" name="B1"><input type="reset" value="Nulstil" name="B2"></p>
</form>
<%
end if
%>