473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

upload multiple files in db with persits aspjpeg

1
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("MyFile") '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

....
th both fields('original_image1 and 'original_image2) upload only the first picture ! where is the mistake ?
thank you
dan
May 10 '07 #1
0 2775

Sign in to post your reply or Sign up for a free account.

Similar topics

32
by: Ray at | last post by:
I despise installing third party software on my workstations or servers. It is for this reason that I use componentless-upload for file uploads. This is no longer an option, and I have to...
5
by: Thomas Brooks | last post by:
Hi there.... I have an ASP routine that I'm writing which updates an Access database with a user name, the file name, etc. all done through parameter processing and SQL functions. I do not...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
0
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle...
1
by: Alex | last post by:
I am having issues with a script to upload files from a client to a webserver. The problem is not with the actual upload but with where it uploads. The whole process is supposed to create a...
4
by: PW | last post by:
I'm writing a small system to allow users to upload documents to my server. I'm using Persist AspUpload for this. I have 2 ASP files. In the first ASP file I prompt the user for a file...
0
by: .Net Sports | last post by:
I'm using Persits.upload module in ASP, and when i use the following form pointed to the object I've always used, i get a "The system cannot find the file specified" error pointing to the line of...
1
by: .Net Sports | last post by:
I'm using Persits.upload module in ASP, and when i use the following form pointed to the object I've always used, i get a "The system cannot find the file specified" error pointing to the line of...
1
by: achotto | last post by:
hi, i try to upload a multiple image files. after that i will rename the files name. the problem is when i upload a 2 or more same files name exp-goal.jpg, it will return "files already exist". ok...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.