Print Page | Close Window

form fields when using ASPsimpleUploads

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8438
Printed Date: 01 April 2026 at 7:18am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: form fields when using ASPsimpleUploads
Posted By: snooper
Subject: form fields when using ASPsimpleUploads
Date Posted: 30 December 2003 at 4:21pm

hey gang

rumour has it that form fields have to be accessed in a different way (from the usual request.form), when there is a file-field in the form.
does anyone know the syntax for ASPsimpleUpload?

many thanks!
Kn




Replies:
Posted By: dpyers
Date Posted: 30 December 2003 at 11:38pm

<HTML>
<HEAD>
<TITLE>AspUpload Live Demo 1: Simple Uploads</TITLE>
</HEAD>
<BODY>

<B>Select 1, 2 or 3 files, then click the Upload button. Images (.gif, .jpg, .png)
will be automatically displayed.</B>
<P>

 <FORM NAME="MyForm" METHOD="POST" ENCTYPE="multipart/form-data"
  ACTION="upload1.asp">
 <TABLE CELLSPACING=0 CELLPADDING=3 BORDER=1>
 <TD BGCOLOR="#FFFFCC">
  <INPUT TYPE=FILE SIZE=40 NAME="FILE1"><BR>
  <INPUT TYPE=FILE SIZE=40 NAME="FILE2"><BR>
  <INPUT TYPE=FILE SIZE=40 NAME="FILE3"><BR>
  <INPUT TYPE=SUBMIT VALUE="Upload">
 
 </TD>
 </TABLE>
 </FORM>
</BODY>
</HTML>

upload1.asp

<%
 Set Upload = Server.CreateObject("Persits.Upload.1")

 Upload.OverwriteFiles = True
 On Error Resume Next

 'Upload.SetMaxSize 1048576 ' Limit files to 1MB
 Count = Upload.SaveVirtual("/Content/Pages/Documents")
%>
<HTML>
<BODY BGCOLOR="#FFFFFF">
<CENTER>

<% If Err <> 0 Then %>

 <FONT SIZE=3 FACE="Arial" COLOR=#0020A0>
 <H3>The following error occured while uploading:</h3>
 </FONT>

 <FONT SIZE=3 FACE="Arial" COLOR=#FF2020>
 <h2>"<% = Err.Description %>"</h2>
 </FONT>

 <FONT SIZE=2 FACE="Arial" COLOR="#0020A0">
 Please <A HREF="../../../TEST/ASPupload/simpleupload/demo1.asp">try again</A>.
 </FONT>

<% Else %>
<FONT SIZE=3 FACE="Arial" COLOR=#0020A0>
<h2>Success! <% = Count %> file(s) have been uploaded.</h2>
</FONT>

<FONT SIZE=3 FACE="Arial" COLOR=#0020A0>
<TABLE BORDER=1 CELLPADDING=3 CELLSPACING=0>
<TH BGCOLOR="#FFFF00">Uploaded File</TH><TH BGCOLOR="#FFFF00">Size</TH><TH BGCOLOR="#FFFF00">Original Size</TH><TR>
<% For Each File in Upload.Files %>
 <% If File.ImageType = "GIF" or File.ImageType = "JPG" or File.ImageType = "PNG" Then %>
  <TD ALIGN=CENTER>
   <IMG SRC="/Content/Pages/Images/<% = File.FileName%>"><BR><B><% = File.OriginalPath%></B><BR>
   (<% = File.ImageWidth %> x <% = File.ImageHeight %> pixels)
  
  </TD>
 <% Else %>
  <TD><B><% = File.OriginalPath %></B>&nbsp;</TD>
 <% End If %>
 <TD ALIGN=RIGHT VALIGN="TOP"><% =File.Size %> bytes</TD>
 <TD ALIGN=RIGHT VALIGN="TOP"><% =File.OriginalSize %> bytes</TD><TR>
<% Next %>
</TABLE>
</FONT>
<P>
<% End If %>
</CENTER>
</BODY>
</HTML>

 



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: snooper
Date Posted: 31 December 2003 at 1:46am
thanks, but thats not ASPimpleUpload


Posted By: dpyers
Date Posted: 31 December 2003 at 6:37am
Arggggh.... You're right. It's the "Simple Upload: demo of ASPUplaod.

-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net