⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual_simple.html

📁 aspupload
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<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 2</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_pressed.gif"> 2. Simple Uploads<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.gif"> <A HREF="manual_misc.html">9. Miscellaneous</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_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_memory.html"><IMG BORDER="0" SRC="next.gif" ALIGN="RIGHT" ALT="Chapter 3: Uploading to Memory"></A>
	<A HREF="manual_intro.html"><IMG BORDER="0" SRC="previous.gif" ALIGN="RIGHT" ALT="Chapter 1: Introduction"></A>
	
	<B><U><FONT SIZE="3" COLOR="#990000">Chapter 2. Uploading Files and Text Items</FONT></U></B>
	<P>
	
	<B><FONT COLOR="#0000A0">A Simple Upload Form</FONT></B>
	<BLOCKQUOTE>
	The following HTML form (located in the sample file <B>Form1.asp</B>) enables a user to select up to three files for uploading 
	to the server:
	<P>

	<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
	<TR><TD BGCOLOR="#E0E0E0">
	<FONT SIZE="1" FACE="Courier New">
	&lt;HTML><BR>
	&lt;BODY BGCOLOR="#FFFFFF"><BR>
	&nbsp;&nbsp;&nbsp;&lt;FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadScript1.asp"><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE="FILE" SIZE="40" NAME="FILE1">&lt;BR><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE="FILE" SIZE="40" NAME="FILE2">&lt;BR><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE="FILE" SIZE="40" NAME="FILE3">&lt;BR><BR>
	&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=SUBMIT VALUE="Upload!"><BR>
	&nbsp;&nbsp;&nbsp;&lt;/FORM><BR>
	&lt;/BODY><BR>
	&lt;/HTML><BR>
	</FONT></TD></TR>
	</TABLE>

	<P>
	Notice the <B><FONT SIZE="2" FACE="Courier New">ENCTYPE="multipart/form-data"</FONT></B> 
	attribute in the &lt;FORM> tag. It instructs the browser to send the entire 
	file to the server and not just the file name entered in the input text box. 
	It is absolutely mandatory that your upload forms contain this attribute, or no uploading can be performed. 
	<P>
	This form contains three items &lt;INPUT TYPE="FILE"> which appear on the page
	as text boxes with the Browse button next to them. Each box can be used to
	select one file only. While the SIZE attribute of an &lt;INPUT TYPE="FILE"> item
	is optional, the NAME attribute is required.
	<P>
	This form invokes the upload script <B>UploadScript1.asp</B> shown below:
	<P>
	<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
	<TR><TD BGCOLOR="#FFFF00">
	<FONT SIZE="1" FACE="Courier New">
	&lt;HTML><BR>
	&lt;BODY><BR>

	&lt;%<BR>
	Set Upload = Server.CreateObject("Persits.Upload")<BR>
	Count = Upload.Save("c:\upload")<P>

	Response.Write Count & " file(s) uploaded to c:\upload"<BR>
	%><BR>

	&lt;/BODY><BR>
	&lt;/HTML>
	</FONT></TD></TR>
	</TABLE>
	<P>
	The first line of the ASP script simply creates an instance of the 
	AspUpload object. The second line calls the <B>Save</B> method of the component 
	which actually performs the upload: it parses the information POSTed by the 
	browser, figures out how many files are being uploaded, 
	and saves them in a specified local directory on the server under their original names. 
	<P>
	The Save method returns the number of files successfully uploaded. In case of an error this method will throw an exception.
	<P>
	Click the link below to run this code sample:
	<P>
	<B><A TARGET="_new" HREF="http://localhost/aspupload/02_simple/Form1.asp">http://localhost/aspupload/02_simple/Form1.asp</A></B>
	&nbsp;<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">FILES and FORM Collections</FONT></B>
	<BLOCKQUOTE>
	Due to the <B>"multipart/form-data"</B> attribute of upload forms, 
	your ASP script can no longer use the built-in <B>Request.Form</B> collection
	to access individual form items. 
	AspUpload solves this problem by offering two collections of its own, <B>Upload.Files</B>
	and <B>Upload.Form</B> to provide access to uploaded files
	and text fields, respectively.
	<P>
	<B>Upload.Files</B> is a collection of <A HREF="object_file.html">UploadedFile</A> 
	objects which offer access to various properties and attributes of uploaded files,
	such as filename, path, size, hash value, etc. The UploadedFile object also offers
	many methods which enable you to manipulate uploaded files (copy, move, save to the database,
	delete, etc.) Individual items of the collection can be referenced
	via numeric or string indices, or iterated through via the For-Each statement.
	<P>
	<B>Upload.Form</B> is a collection of <A HREF="object_formitem.html">FormItem</A>
	objects that represent text fields on an upload form. Upload.Form is similar
	to Request.Form and should be used instead of the latter in your upload script. 
	The FormItem object provides two properties, Name and Value.
	<P>
	The use of the Files and Form collections is demonstrated by the sample files
	<B>Form2.asp</B> and <B>UploadScript2.asp</B>:
	<P>
	<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
	<TR><TD BGCOLOR="#E0E0E0">
	<FONT SIZE="1" FACE="Courier New">
	&lt;HTML><BR>
	&lt;BODY BGCOLOR="#FFFFFF"><BR>
	&nbsp;&nbsp;&nbsp;&lt;FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadScript2.asp"><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File 1:&lt;INPUT TYPE=FILE NAME="FILE1"><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description 1:&lt;INPUT TYPE=TEXT NAME="DESCR1">&lt;BR><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File 2:&lt;INPUT TYPE=FILE NAME="FILE2"><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description 2:&lt;INPUT TYPE=TEXT NAME="DESCR2">&lt;BR><BR>
	&nbsp;&nbsp;&nbsp;&lt;INPUT TYPE=SUBMIT VALUE="Upload!"><BR>
	&nbsp;&nbsp;&nbsp;&lt;/FORM><BR>
	&lt;/BODY><BR>
	&lt;/HTML><BR> 
	</FONT></TD></TR>
	</TABLE>	
	<P>
	This form contains both &lt;INPUT TYPE=FILE> and regular &lt;INPUT TYPE=TEXT> items.
	It invokes the script <B>UploadScript2.asp</B>:
	<P>

	<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
	<TR><TD BGCOLOR="#FFFF00">
	<FONT SIZE="1" FACE="Courier New">
	&lt;HTML><BR>
	&lt;BODY><P>

	&lt;%<BR>
		Set Upload = Server.CreateObject("Persits.Upload.1")<BR>
		Upload.Save "c:\upload"<BR>
	%><P>

	Files:&lt;BR><BR>

	&lt;%<BR>
	For Each File in Upload.Files<BR>
		Response.Write File.Name & "= " & File.Path & " (" & File.Size &" bytes)&lt;BR>"<BR>
	Next<BR>
	%><P>

	&lt;P><P>

	Other items:&lt;BR><BR>
	&lt;%<BR>
	For Each Item in Upload.Form<BR>
		Response.Write Item.Name & "= " & Item.Value & "&lt;BR>"<BR>
	Next<BR>
	%><BR>

	&lt;/BODY><BR>
	&lt;/HTML>
	</FONT></TD></TR>
	</TABLE>
	<P>

	Click the link below to run this code sample:
	<P>
	<B><A TARGET="_new" HREF="http://localhost/aspupload/02_simple/Form2.asp">http://localhost/aspupload/02_simple/Form2.asp</A></B>
	&nbsp;<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>
	<P>
	The output should look similar to this:<P>

	<FONT COLOR="#804000">
	Files:<BR>
	FILE1=c:\upload\File1.xls (108544 bytes)<BR>
	FILE2=c:\upload\File2.zip (211687 bytes)<P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -