开发者

How to upload an image

HI, I am using asp as server side script. I am calling asp page from java by HttpURLConne开发者_如何学Pythonction and passing the image by ImageIO.write() method. can any body tell me how can I upload that file from asp into my server directory.


For a pure (no DLL) upload, you should look at a Pure ASP Upload or check out this article

But, a more common, tested, with better performance solution is installing a third party library. I like AbcUpload from WebSuperGoo (free with LinkBack license)

basicupload.htm

<html>
<body>
<form method="post" action="basicupload.asp" enctype="multipart/form-data">
<input type="file" name="filefield"><br>
<input type="submit" name="submit" value="submit">
</form>
<body>
</html> 

basicupload.asp

<% @Language="VBScript" %>
<%
Set theForm = Server.CreateObject("ABCUpload4.XForm")
theForm.Overwrite = True
If theForm.Files("filefield").FileExists Then
   theForm.Files("filefield").Save "myupload.dat"
End If
%>
<html>
<body>
File uploaded...
</body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜