asp classic - Upload and display picture -
i have created shadowupload.asp , upload.asp. works but, want display picture uploaded don't know how display it
my source code is
<!-- #include file="shadowupload.asp" --> <form action="<%=request.servervariables( "script_name" )%>?action=1" enctype="multipart/form-data" method="post"> picture profile: <input type="file" name="file1" value="<%=mypicture%>" /><br /> <button type="submit">upload</button> </form> <img border="0" src="<%=mypicture%>" width="90" height="100">` <% dim objupload if request("action")="1" set objupload=new shadowupload if objupload.geterror<>"" response.write("sorry, not upload: "&objupload.geterror) else ` response.write("found "&objupload.filecount&" files...<br />") x=0 objupload.filecount-1` if (objupload.file(x).imagewidth>200) or (objupload.file(x).imageheight>200) response.write("image big, not saving!") else call objupload.file(x).savetodisk(server.mappath("uploads"), "") response.write("file saved successfully!") end if response.write("<hr />") next end if end if %>
you need add image every file uploaded, , if uploaded successfully:
if (objupload.file(x).imagewidth>200) or (objupload.file(x).imageheight>200) response.write("image big, not saving!") else call objupload.file(x).savetodisk(server.mappath("uploads"), "") response.write("file saved successfully!") response.write("<br /><img src=""uploads/" & objupload.file(x).filename & """ height=""50"" />") end if
this show preview of uploaded picture, set height of 50 pixels.
Comments
Post a Comment