priyanka

priyanka

  • NA
  • 215
  • 123.2k

Code to upload file in classic asp

Jun 27 2017 8:55 AM
Here is my woking code
 
If objUpload.GetError<>"" Then
Response.Write("sorry, could not upload: "&objUpload.GetError)
Else
Response.Write("found "&objUpload.FileCount&" files...<br />")
For x=0 To objUpload.FileCount-1
Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
Response.Write("file size: "&objUpload.File(x).Size&"<br />")
Response.Write("image width: "&objUpload.File(x).ImageWidth&"<br />")
Response.Write("image height: "&objUpload.File(x).ImageHeight&"<br />")
If (objUpload.File(x).ImageWidth>200) Or (objUpload.File(x).ImageHeight>200) Then
Response.Write("image to big, not saving!")
Else
Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
Response.Redirect("default.asp?mess=1")
Response.Write("file saved successfully!")
End If
Response.Write("<hr />")
Next
Response.Write("thank you, "&objUpload("name"))
End If
 
 
<form action="<%=Request.ServerVariables("SCRIPT_NAME")%>?action=1" method="POST" enctype="multipart/form-data">
 
Please Suggest me what i am doing wrong.I have referred many link the code part is same as i have used.But it throws the same error  500 internal server error not found
 
 
 
 

Answers (4)