CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Upload Info into database? How?!

Print topic Send  topic

Author Message
Simon
Posted: 01/23/2003, 3:45 PM

I have got a script which uploads files;

The form:

<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>

and the upload1.asp page:


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

Upload.OverwriteFiles = False
On Error Resume Next

Upload.SetMaxSize 1048576 ' Limit files to 1MB
Count = Upload.Save("c:\images")
%>
<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="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="/uploaddir/<% = File.FileName%>"><BR><B><% = File.OriginalPath%></B><BR>
(<% = File.ImageWidth %> x <% = File.ImageHeight %> pixels)

</TD>
<% Else %>
<TD><B><% = File.OriginalPath %></B></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>
<FONT SIZE=2 FACE="Arial" COLOR=#0020A0>
Click <A HREF="demo1.asp">here</A> to upload more files.
</FONT>
<% End If %>

<HR>
<FONT SIZE=2 FACE="Arial" COLOR=#0020A0>
<A HREF="http://www.persits.com/aspupload.exe">Download</A> your trial copy of AspUpload.
</FONT>



</CENTER>
</BODY>
</HTML>

In the database I have serveral fields, including picture_url, picture2_url, name, description etc. I would like to be able to integrate the above code so that I can enter/update all of the information, upload the pictures and place the correct urls into the database.

For example if I made an entry with the following; Nmae: Simon, Description: Male aged 19 blah, blah, blah. picture_url: images/simon1.jpg picture2_url: images/simon2.jpg.

How would I go about doing this in codecharge studio? Help would be great as I'm stuck at this point.

Thanks
Simon
SW
Posted: 01/25/2003, 7:10 AM

Anyone?!

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.