|
SA-FileUp™ SA-FileUp™ allows users with a web browser to upload or
transmit files from their local hard disk to a Microsoft Internet Information
Server (IIS) web server. Files can be of any format, such as Word documents,
images, or plain text. SA-FileUp also provides a secure download feature that
enables web developers to protect content so it is only available via their web
application.
Developers can use SA-FileUp to receive and process
user input while staying within the context of their Active Server Pages
application.
** Note from BP Support:
You will need to request permission changes on your directories
in order for SA-FileUp to work. You must first determine who you
want to be able to upload to your site and which areas you want
them to have access to. Have this information available when you
call or email techsupport@buildersplanet.com
**
Key Features:
- Server-side component - requires no software be
installed on user's PC
- Fully scriptable by Active Server Pages (ASP)
- Compliant with HTML 3.2 and Internet standard RFC
1867
- Works with Netscape 2.x and above
- Works with the following versions of Internet
Explorer
- IE 4.0 and IE 5.0, or later
- IE 3.02a (16-bit)
- IE 3.02 (32-bit) but requires the File Upload
Add-on available free from Microsoft.
- Performance Monitor counters allow for more
careful tracking of uploading information.
- Server-side progress indicator lets you monitor
the progress of your uploads.
The following is a simple sample. Create two files,
the first one titled "uptest1.asp":
<FORM ACTION="uptest2.asp" ENCTYPE="MULTIPART/FORM-DATA" METHOD="POST">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP">Enter Filename:</TD>
<%
'---
'--- Note the use of the TYPE="FILE" specification
'---
%>
<TD ALIGN="LEFT"><INPUT TYPE="FILE" NAME="FILE1"><BR>
<B><I><SMALL>Note: if a button labeled "Browse..." does not appear, then your
browser does not support File Upload. For Internet Explorer 3.02 users, a
free add-on is available from Microsoft. Please see the SA-FileUp documentation
for more information.</SMALL></I></B>
</TD>
</TR>
<TR>
<TD ALIGN="RIGHT"> </TD>
<TD ALIGN="LEFT"><INPUT TYPE="SUBMIT" NAME="SUB1" VALUE="Upload File"></TD>
</TR>
</TABLE>
</FORM> | The second file should be titled "uptest2.asp"
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Simple File Upload Results</TITLE>
</HEAD>
<BODY>
<%
'---
'--- Instanciate SA-FileUp
'---
Set upl = Server.CreateObject("SoftArtisans.FileUp")
%><P>The file was successfully transmitted by the user.</P>
<%
on error resume next
'---
'--- Save the file now. YOU MUST USE SAVEINVIRTUAL!!
'---
upl.SaveinVirtual "temp.txt" if Err <> 0 Then %>
<H1><FONT COLOR="#ff0000">An error occurred when saving the file on the server.</FONT></H1>
Possible causes include:
<UL>
<LI>
<%Response.Write err.description %> <LI>An incorrect filename was specified
<LI>File permissions do not allow writing to the specified area
</UL>
Please check the SA-FileUp documentation for more troubleshooting information,
or send e-mail to <A HREF="mailto:info@softartisans.com">info@softartisans.com</A> <% Else
Response.Write("Upload saved successfully to " & upl.ServerName)
End If %>
<P> </P>
<FONT SIZE="-1"><CENTER>
<TABLE WIDTH="80%" BORDER="1" CELLSPACING="2" CELLPADDING="0" HEIGHT="206">
<TR>
<TD COLSPAN="2"><P><CENTER>Information About The Uploaded File</CENTER></TD></TR>
<TR>
<TD WIDTH="30%" HEIGHT="27" ALIGN="RIGHT" VALIGN="TOP"> User's filename</TD>
<TD WIDTH="70%"><%=upl.UserFilename%> </TD></TR>
<TR>
<TD WIDTH="30%" HEIGHT="27" ALIGN="RIGHT" VALIGN="TOP">Size in bytes </TD>
<TD WIDTH="70%"><%=upl.TotalBytes%> </TD></TR>
<TR>
<TD WIDTH="30%" HEIGHT="27" ALIGN="RIGHT" VALIGN="TOP">Content Type</TD>
<TD WIDTH="70%"><%=upl.ContentType%> </TD></TR>
<TR>
<TD WIDTH="30%" HEIGHT="27" ALIGN="RIGHT" VALIGN="TOP">Content Disposition</TD>
<TD WIDTH="70%"><%=upl.ContentDisposition%> </TD></TR>
<TR>
<TD WIDTH="30%" HEIGHT="27" ALIGN="RIGHT" VALIGN="TOP">MIME Version</TD>
<TD WIDTH="70%"><%=upl.MimeVersion%> </TD></TR>
<TR>
<TD WIDTH="30%" HEIGHT="27" ALIGN="RIGHT" VALIGN="TOP">Content Transfer Encoding</TD>
<TD WIDTH="70%"><%=upl.ContentTransferEncoding%> </TD></TR>
</TABLE>
</FONT></CENTER>
<% End If %>
</BODY>
</HTML> |
Please check the Software Artisans' web site for the
latest documentation and samples.
** Note from HPH Support: For
security purposes, we have disabled .Save. You must use .SaveInVirtual. We did
not install SA-Archive, SA-SmtpMail or SA-FileManager.**
Here are some tips on using
SaveInVirtual:
When using SaveInVirtual, the file is automatically saved to the directory
the script is in. Let's say that this is your directory structure:
/html
/subfolder1
/subfolder2 /subofsub2 /subfolder3
If your upload file was in /subfolder2, your file would automatically save
there if you used this: upl.SaveinVirtual "test.txt"
However, if you want to preserve the file name, you would use
this: upl.SaveinVirtual "/subfolder2" That would save whatever you
uploaded into /subfolder2.
If you wished to save the file into /subofsub2, you would use
this: upl.SaveinVirtual "/subfolder2/subofsub2" Again, that would preserve
the original file name.
|