|
We create an XForm object and tell it that we will be using absolute
pathnames rather than virtual ones. If a file has been uploaded
we save it out to an absolute path that we specify. Here we are
using SafeFileName to name the file - this is a Windows safe version
of the original file name in Unicode format.
If the file came from a Macintosh the SafeFileName will contain
the name of the file converted into the format used by Windows NT
Services For Macintosh (SFM). If the file was uploaded by Internet
Explorer and is saved to a SFM volume Macintosh users will see a
file identical to the original uploaded file with both resource
and data forks intact.
<% @Language="VBScript" %>
<html>
<body>
<%
Set theForm = Server.CreateObject("ABCUpload4.XForm")
theForm.AbsolutePath = True
Set theField = theForm.Files("file")
If theField.FileExists Then
theField.Save "C:\" & theField.SafeFileName
Response.Write "File uploaded..."
Else
Response.Write "No file uploaded..."
End If
%>
</body>
</html>
|