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

📄 codesample.html

📁 aspupload
💻 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="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, RFC1867, RFC-1867, 1867, Component, ENCTYPE, multipart/form-data, multipart, SA-FileUp, ActiveFile, Database, Multiple, download, downloading, unique, form, limit, size">
   <meta name="DESCRIPTION" content="AspUpload.com - Code Samples">
<TITLE>AspUpload.com - ASP Upload Code Samples</TITLE>
</HEAD>
<BODY BACKGROUND="bk.gif">
<BASEFONT FACE="Helvetica, Arial" SIZE=1>

<!-- Main Data table -->
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=680>
<TD VALIGN=TOP WIDTH=140>
<FONT FACE="arial narrow" Size=2>
<B>
	<IMG SRC="spacer.gif" BORDER="0" HEIGHT="15"><BR>
	<IMG SRC="square.gif"> <A HREF="index.html">Home</A>
	<BR>
	<IMG SRC="square.gif"> <A HREF="whatsnew.html">What's New</A>
	<P>
	<IMG SRC="square.gif"> <A HREF="about.html">About AspUpload</A>
	<BR>
	<IMG SRC="square_pressed.gif"> Code Samples
	<BR>
	<IMG SRC="square.gif"> <A HREF="livedemo.html">Live Demo</A>
	<BR>
	<IMG SRC="square.gif"> <A HREF="faq.html">FAQ</A>
	<P>
	<IMG SRC="square.gif"> <A HREF="xupload.html">XUpload</A><BR>
	<IMG SRC="square.gif"> <A HREF="jupload.html">JUpload</A> <FONT COLOR="#FF0000"><i>NEW</i></FONT><BR>
	<IMG SRC="square.gif"> <A HREF="aspjpeg.html">AspJpeg</A> <FONT COLOR="#FF0000"><i>NEW</i></FONT><BR>
	<P>
	<IMG SRC="square.gif"> <A HREF="download.html">Download</A>
	<BR>
	<IMG SRC="square.gif"> <A HREF="purchase.html">Purchase</A>
	<P>
	<IMG SRC="square.gif"> <A HREF="clients.html">Clients</A>
	<BR>
	<IMG SRC="square.gif"> <A HREF="testimonials.html">Testimonials</A>
	<BR>
	<IMG SRC="square.gif"> <A HREF="otherproducts.html">Other Products</A>
	<P>
	<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"><B>Newsletter Signup</B></FONT><BR>
	<INPUT TYPE="TEXT" NAME="email" SIZE="15" VALUE="e-mail address"></FORM>

	<A HREF="http://www.persits.com"><IMG SRC="copyright.gif" BORDER=0></A>
</B>
</FONT>
</TD>
<TD VALIGN=TOP WIDTH=540>
<!-- Right Colum with data -->
	
	<img SRC="codesample.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 FACE=ARIAL SIZE=2>
<B>HTML form for uploading up to 3 files, which also contains
 a text description field, and a multiple select control:</B>
</FONT>

<FONT FACE="Courier New" Size=1>
<BLOCKQUOTE>
	&lt;HTML> <BR>
	&lt;BODY BGCOLOR="#FFFFFF"> <BR>
	&lt;FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="Upload.asp"> <BR>
	&lt;INPUT TYPE=FILE NAME="FILE1">&lt;BR> <BR>
	&lt;INPUT TYPE=FILE NAME="FILE2">&lt;BR> <BR>
	&lt;INPUT TYPE=FILE NAME="FILE3">&lt;BR> <BR><BR>
	&lt;INPUT TYPE=TEXT NAME="DESCRIPTION">&lt;BR> <BR><BR>
	&lt;SELECT NAME="CATEGORY" MULTIPLE><BR>
	&lt;OPTION>Image<BR>
	&lt;OPTION>Text<BR>
	&lt;OPTION>Source Code<BR>
	&lt;OPTION>Archive<BR>
	&lt;/SELECT>&lt;BR><BR><BR>
	&lt;INPUT TYPE=SUBMIT VALUE="Upload!"> <BR>
	&lt;/FORM> <BR>
	&lt;/BODY> <BR>
	&lt;/HTML> <BR>
</BLOCKQUOTE>
</FONT>

<P>
<FONT FACE=ARIAL SIZE=2>
<B>Corresponding Upload Script (Upload.asp):</B>
</FONT>
<FONT FACE="Courier New" Size=2>
<BLOCKQUOTE>

&lt;%<BR>
<B>Set Upload = Server.CreateObject("Persits.Upload.1")</B><BR>
<BR>
<i>' Upload files</I><BR>
<B>Upload.OverwriteFiles = False</B> ' Generate unique names<BR>
<B>Upload.SetMaxSize 1048576</B> ' Truncate files above 1MB<BR>
<B>Upload.Save "c:\upload"</B> <BR>
<BR>
<I>' Process all files received</I><BR>
<B>For Each File in Upload.Files</B><BR>
<BR>
&nbsp;&nbsp;<i>' Save in the database as blob</I><BR>
&nbsp;&nbsp;<B>File.ToDatabase "DSN=data;UID=sa;PWD=zzz;", _</B>
<BR>
&nbsp;&nbsp;&nbsp;<B>"insert into mytable(blob) values(?)"</B><BR>
<BR>
&nbsp;&nbsp;<I>' Move to a different location</I><BR>
&nbsp;&nbsp;<B>File.Copy "d:\archive\" & File.ExtractFileName</B><BR>
&nbsp;&nbsp;<B>File.Delete</B><BR>
<B>Next</B><P>
<I>' Display description field</I><BR>
<B>Response.Write Upload.Form("Description") & "&lt;BR>"</B><P>

<I>' Display all selected categories</I><BR>
<B>For Each Item in Upload.Form</B><BR>
&nbsp;&nbsp;<B>If Item.Name = "Category" Then</B><BR>
&nbsp;&nbsp;&nbsp;&nbsp;<B>Response.Write Item.Value & "&lt;BR>"</B><BR>
&nbsp;&nbsp;<B>End If</B><BR>
<B>Next</B><BR>

%>

</BLOCKQUOTE>
</FONT>

	<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 FACE=ARIAL SIZE=2>
	Around 20 more code samples are included with the AspUpload evaluation <A HREF="download.html">download</A>.
	If you wish to learn how to use AspUpload to send email messages with <B>file attachments</B>, 
	download your copy of the free SMTP component <A HREF="http://www.aspemail.com">AspEmail</A> 
	which comes with a demo message-sending ASP application.
	</FONT>
	<P>

	<TABLE WIDTH=540 HEIGHT=2 CELLSPACING=0 CELLPADDING=0 BORDER=0>
	<TD BGcolor="#FFCE00"><spacer type=block width=540 height=2></TD>
	</TABLE>	

	<P>
	<CENTER>
	<A HREF="index.html"><IMG SRC="logo_small.gif" BORDER=0></A>
	<BR>
	<FONT Face=arial size=1>
	Copyright &copy; 1999 <A HREF="http://www.persits.com">Persits Software, Inc.</A><BR>
	All Rights Reserved<BR>
	Questions? Comments? <A HREF="MAILTO:info@aspupload.com">Write us!</A>
	</CENTER>	

</TD>
</TABLE>

</BASEFONT>
</BODY>
</HTML>

⌨️ 快捷键说明

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