📄 manual_misc.html
字号:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="KEYWORDS" content="ASP UPLOAD ASPUPLOAD PWS BLOB Personal Web Server IIS Internet Information Server ASP UPLOADING UPLOAD DEC ALPHA AlphaServer AspUpload Persits Software Persits Web ASP Active Server Pages Active Server Component Upload browser TYPE=FILE TYPE FILE Windows NT Web ACL ACE Access Control List Directory Listing Export Attribute FILE FREE RFC ie3 ie4 posting acceptor posting acceptor RFC1867 RFC-1867 1867 Component ENCTYPE multipart/form-data multipart SA-FileUp ActiveFile Database Multiple software artisans activefile vbscript activex jscript netscape internet explorer download downloading unique form limit size">
<meta name="KEYWORDS" content="ASP, UPLOAD, ASPUPLOAD, PWS, BLOB, Personal Web Server, IIS, Internet Information Server, ASP, UPLOADING, UPLOAD, DEC, ALPHA, AlphaServer, AspUpload, Persits Software, Persits, Web, ASP, Active Server Pages, Active Server Component, Upload, browser, TYPE=FILE, TYPE, FILE, Windows, NT, Web, ACL, ACE, Access Control List, Directory, Listing, Export, Attribute, FILE, FREE, RFC, ie3, ie4, posting acceptor, posting, acceptor, RFC1867, RFC-1867, 1867, Component, ENCTYPE, multipart/form-data, multipart, SA-FileUp, ActiveFile, Database, Multiple, software, artisans, activefile, vbscript, activex, jscript, netscape, internet, explorer, download, downloading, unique, form, limit, size">
<meta name="DESCRIPTION" content="AspUpload.com - the home of the most advanced upload solution for a Windows NT/ASP-based Web environment">
<TITLE>AspUpload.com - User Manual. Chapter 7</TITLE>
</HEAD>
<BODY BACKGROUND="bk.gif" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<BASEFONT FACE="Helvetica, Arial" SIZE=1>
<!-- Main Data table -->
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="705">
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="160">
<FONT FACE="arial narrow" Size=2>
<B>
<IMG SRC="spacer.gif" BORDER="0" HEIGHT="15"><BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="index.html">Home</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="whatsnew.html">What's New</A>
<P>
<IMG SRC="sq.gif"><IMG SRC="square_pressed.gif"> <A HREF="manual.html">User Manual</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_intro.html">1. Introduction</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_simple.html">2. Simple Uploads</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_memory.html">3. Memory Uploads</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_db.html">4. Database</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_progress.html">5. Progress Bar</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_security.html">6. Security</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_image.html">7. Images</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_unicode.html">8. Unicode</A><BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small_pressed.gif"> 9. Miscellaneous<BR>
<IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="sq.gif"><IMG SRC="square_small.gif"> <A HREF="manual_share.html">10. Hosting Issues</A><BR>
<P>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="objectreference.html">Object Reference</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="livedemo.html">Live Demos</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="support.html">Support</A>
<P>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="xupload.html">XUpload</A><BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="jupload.html">JUpload</A><BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="aspjpeg.html">AspJpeg</A><BR>
<P>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="download.html">Download</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="purchase.html">Purchase</A>
<P>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="clients.html">Clients</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="otherproducts.html">Other Products</A>
<BR>
<IMG SRC="sq.gif"><IMG SRC="square.gif"> <A HREF="contact.html">Contact Us</A>
<FORM TARGET="_new" ACTION="http://support.persits.com/emails/signup.asp">
<FONT FACE="Arial Narrow" SIZE="2" COLOR="#9C3131"><IMG SRC="sq.gif"><B>Newsletter Signup</B></FONT><BR>
<IMG SRC="sq.gif"><INPUT TYPE="TEXT" NAME="email" SIZE="15" VALUE="e-mail address"></FORM>
</B>
</FONT>
</TD>
<TD VALIGN=TOP WIDTH=545 ALIGN="LEFT">
<!-- Right Column with data -->
<IMG SRC="sq.gif"><BR>
<IMG SRC="manual.gif">
<BR>
<TABLE WIDTH=540 HEIGHT=2 CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TD BGcolor="#FFCE00"><spacer type=block width=540 height=2></TD>
</TABLE>
<P>
<FONT SIZE=2 FACE=ARIAL COLOR="#000000">
<A HREF="manual_share.html"><IMG BORDER="0" SRC="next.gif" ALIGN="RIGHT" ALT="Chapter 10: Using AspUpload in a Shared Environment"></A>
<A HREF="manual_unicode.html"><IMG BORDER="0" SRC="previous.gif" ALIGN="RIGHT" ALT="Chapter 8: Unicode Support"></A>
<B><U><FONT SIZE="3" COLOR="#990000">Chapter 9. Miscellaneous Features</FONT></U></B>
<P>
<B><FONT COLOR="#0000A0">AspUpload's Non-Upload Functionality</FONT></B>
<BLOCKQUOTE>
AspUpload's functionality is not limited to file uploading.
It is a complete file management solution. Other AspUpload features
include secure file downloading, directory listing, and ActiveX registration.
<P>
</BLOCKQUOTE>
<B><FONT COLOR="#0000A0">Secure File Downloading</FONT></B>
<BLOCKQUOTE>
With AspUpload, you can let your users download files
which are not necessarily resizing in a virtual directory, but anywhere on the server's hard drive
or even a remote machine.
<P>
File downloading is implemented with the method <B>Upload.SendBinary</B>,
as follows:
<P>
<FONT FACE="Courier New"><B>
Set Upload = Server.CreateObject("Persits.Upload")<BR>
Upload.SendBinary "c:\path\file.ext", True, "application/octet-stream", True
</B></FONT>
<P>
The <B>SendBinary</B> method takes a physical file path as the first parameter.
If the second parameter is set to True, SendBinary
automatically builds the headers Content-Type, Content-Disposition
and Content-Length. The third parameter is optional and specifies the
Content-Type value. If this parameter is omitted,
the method obtains Content-Type from the system registry based on the file extension.
<P>
The fourth optional parameter, if set to True, specifies whether the Content-Disposition
header should contain the keyword "attachment;" This is necessary
to force a "Save As" dialog box instead of opening the file in-place by the IE browser.
<P>
To use the SendBinary method, you need to provide a link on your page pointing
to an ASP script which calls SendBinary. The sample files <B>text.asp</B>
and <B>text_download.asp</B> demonstrate this technique:
<P>
<B>text.asp</B><BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
<TR><TD BGCOLOR="#E0E0E0">
<FONT SIZE="1" FACE="Courier New">
<HTML><BR>
<BODY><BR>
<h3>File Downloads</h3><P>
Click on this link to download a file:<p><P>
<A HREF="text_download.asp">test.txt</A><P>
</BODY><BR>
</HTML><BR>
</FONT></TD></TR>
</TABLE>
<P>
<B>text_download.asp</B><BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
<TR><TD BGCOLOR="#FFFF00">
<FONT SIZE="1" FACE="Courier New">
<%<BR>
' AspUpload Code samples: text_download.asp<BR>
' Invoked by text.asp<BR>
' Copyright (c) 2001 Persits Software, Inc<P>
' This file must not contain any HTML tags<P>
Set Upload = Server.CreateObject("Persits.Upload")<P>
' Build path to file<BR>
Path = Server.MapPath("test.txt")<P>
' Parmeters:<BR>
' 1. Path to file to download<BR>
' 2. Yes, build content-xxx headers<BR>
' 3. Use this value for Content-Type header<BR>
' 4. Include the word "attachment;" to Content-Disposition to force download<P>
Upload.SendBinary Path, True, "application/octet-binary", True<BR>
%>
</FONT></TD></TR>
</TABLE>
<P>
Click the link below to run this code sample:
<P>
<B><A TARGET="_new" HREF="http://localhost/aspupload/09_misc/text.asp">http://localhost/aspupload/09_misc/text.asp</A></B>
<A HREF="javascript:;" OnClick="open('helppopup.html','','width=400,height=400');"><IMG SRC="help.gif" BORDER="0" ALT="Why is this link not working?"></A>
</BLOCKQUOTE>
<B><FONT COLOR="#0000A0">Directory Listing</FONT></B>
<BLOCKQUOTE>
Besides <B>Form</B> and <B>Files</B> collections,
UploadManager provides one more collection, <B>Upload.Directory</B>,
which represents all files and subdirectories of a directory on your hard drive.
<P>
The Directory collection consists of DirectoryItem objects.
Each DirectoryItem object represents a file or subdirectory inside
this directory. All the file and subdirectory items are always grouped
together, with subdirectories preceding files in the collection.
Within the subdirectory and file groups, items can be sorted by name,
type, size, creation time, last modification time and last access time.
<P>
The following code snippet creates and scrolls through a Directory
collection which represents all files in the folder "c:\mydir"
sorted by file type:
<P>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
<TR><TD BGCOLOR="#FFFF00">
<FONT SIZE="1" FACE="Courier New">
<%<P>
<!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"--><P>
Set Upload = Server.CreateObject("Persits.Upload")<BR>
Set Dir = Upload.Directory( "c:\mydir\*.*", SORTBY_TYPE)<BR>
For Each item in Dir<BR>
Response.Write item.FileName &"<BR>"<BR>
Next<BR>
%>
</FONT></TD></TR>
</TABLE>
<P>
The first argument of the <B>Directory</B> property is a directory name
and a file name which can contain wildcard characters (* and ?).
<P>
The second argument is optional and, if used, must be set to one of the
Sort-by values defined in the AspUpload type library. The default value is
SORTBY_NAME (numeric 1). The other valid values for the 2nd parameter
are SORTBY_TYPE (2), SORTBY_SIZE (3), SORTBY_CREATIONTIME (4),
SORTBY_LASTWRITETIME (5), and SORTBY_LASTACCESSTIME (6).
<P>
To use this and other constants defined in the AspUpload type library, use the metadata
tag
<P>
<B><!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"--></B>
<P>
The third argument is also optional. It is a Boolean value which
specifies whether to sort in an ascending (if set to True or omitted)
or descending (if False) order.
<P>
The code sample <B>DirectoryListing.asp</B> in conjunction with
the script <B>download.asp</B> demonstrates the directory listing
and download functionality of AspUpload.
<P>
<B>DirectoryListing.asp</B><BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
<TR><TD BGCOLOR="#FFFF00">
<FONT SIZE="1" FACE="Courier New">
<HTML><BR>
<HEAD><BR>
<!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"--> <BR>
</HEAD><BR>
<BODY><p>
<H3>Directory Listing</H3><P>
<%<BR>
If Request("Dir") = "" Then<BR>
Directory = "c:\"<BR>
Else<BR>
Directory = Request("Dir")<BR>
End If<P>
Set Upload = Server.CreateObject("Persits.Upload")<BR>
Set Dir = Upload.Directory( Directory & "*.*", , True)<BR>
%><P>
<h2><% = Dir.Path %></h2><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -