Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 10th, 2007, 11:20 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default upload multiple files in db with persits aspjpeg

hello,

i try to upload in an access db two pictures at the same time. i use the adjusted sample code from persits. it looks like this:
...
'<%
' Create an instance of AspUpload object
'Set Upload = Server.CreateObject("Persits.Upload")
' Capture uploaded file. Save returns the number of files uploaded
'Count = Upload.Save(Path)

'If Count = 0 Then
'Response.Write "message"
'Response.End
'Else
' Obtain File objects representing uploaded files
'Set File1 = Upload.Files("MyFile1") 'name of input object
'Set File2 = Upload.Files("MyFile2")
' Is this a valid image file?
'If File1.ImageType <> "UNKNOWN" or File2.ImageType <> "UNKNOWN" Then
' create instance of AspJpeg object
'Set jpeg1 = Server.CreateObject("Persits.Jpeg")
'Set jpeg2 = Server.CreateObject("Persits.Jpeg")
' open uploaded file
'jpeg1.Open( File1.Path )
'jpeg2.Open( File2.Path )
' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form instead.
'jpeg1.Width = jpeg1.OriginalWidth * Upload.Form("scale") / 100
'jpeg1.Height = jpeg1.OriginalHeight * Upload.Form("scale") / 100

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form instead.
'jpeg2.Width = jpeg2.OriginalWidth * Upload.Form("scale") / 100
'jpeg2.Height = jpeg2.OriginalHeight * Upload.Form("scale") / 100

'SavePath = Path & "\small_" & File1.ExtractFileName
'SavePath = Path & "\small_" & File2.ExtractFileName
' AspJpeg always generates JPEG thumbnails regardless of original format.
' If the original file was not a JPEG, append .JPG extension.
'If UCase(Right(SavePath, 3)) <> "JPG" Then
'SavePath = SavePath & ".jpg"
'End If
'jpeg.Save SavePath
'jpeg2.Save SavePath
' Using ADO, save both images in the database along with description.
'strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & 'Server.MapPath("\iisadmin") &
"\db\lobal.mdb;" & ";" & "Persist Security Info=False"
'Set rs = Server.CreateObject("adodb.recordset")
'rs.Open "alte", strConnect, 1, 3
'rs.AddNew
' Use File.Binary to access binary data of uploaded file.
'rs("original_image1").Value = File.Binary
'Set ThumbFile1 = Upload.OpenFile(SavePath)
'rs("thumbnail1").Value = ThumbFile.Binary
' Use File.Binary to access binary data of uploaded file.
'rs("original_image2").Value = File2.Binary
'Set ThumbFile2 = Upload.OpenFile(SavePath)
'rs("thumbnail2").Value = ThumbFile2.Binary

....
the both fields('original_image1 and 'original_image2) upload only the first picture ! where is the mistake ?
thank you
dan



Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload Multiple Files Anypond .NET Framework 2.0 1 February 21st, 2008 05:07 AM
How to upload data in multiple files at once? hwsc Pro VB Databases 2 June 27th, 2007 05:25 AM
UPLOAD - MULTIPLE - FILES cli PHP How-To 5 May 29th, 2005 04:59 PM
How to upload multiple Files at once hwsc VB How-To 1 January 23rd, 2005 12:45 PM
Q. How do I upload files to a DB and view them? richard.york PHP FAQs 0 April 3rd, 2004 07:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.