views:

101

answers:

2

I want a simple method to upload file in ASP.
Just one function

A: 

Maybe this helps: Microsoft Post Acceptor

ollifant
+2  A: 

Edit: from the downvote, I realize that you ask for a no DLL answer, for that, you should look at a Pure ASP Upload or check out this article

Better yet, google for "Upload pure vbscript"

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>
Eduardo Molteni