473,563 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

upload multiple files in db with persits aspjpeg

1 New Member
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.CreateOb ject("Persits.U pload")
' Capture uploaded file. Save returns the number of files uploaded
'Count = Upload.Save(Pat h)
'If Count = 0 Then
'Response.Write "message"
'Response.End
'Else
' Obtain File objects representing uploaded files
'Set File1 = Upload.Files("M yFile") 'name of input object
'Set File2 = Upload.Files("M yFile2")
' Is this a valid image file?
'If File1.ImageType <> "UNKNOWN" or File2.ImageType <> "UNKNOWN" Then
' create instance of AspJpeg object
'Set jpeg1 = Server.CreateOb ject("Persits.J peg")
'Set jpeg2 = Server.CreateOb ject("Persits.J peg")
' 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.OriginalW idth * Upload.Form("sc ale") / 100
'jpeg1.Height = jpeg1.OriginalH eight * Upload.Form("sc ale") / 100

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form instead.
'jpeg2.Width = jpeg2.OriginalW idth * Upload.Form("sc ale") / 100
'jpeg2.Height = jpeg2.OriginalH eight * Upload.Form("sc ale") / 100

'SavePath = Path & "\small_" & File1.ExtractFi leName
'SavePath = Path & "\small_" & File2.ExtractFi leName
' AspJpeg always generates JPEG thumbnails regardless of original format.
' If the original file was not a JPEG, append .JPG extension.
'If UCase(Right(Sav ePath, 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={Micros oft Access Driver (*.mdb)};DBQ=" & 'Server.MapPath ("\iisadmin" ) &
"\db\lobal.mdb; " & ";" & "Persist Security Info=False"
'Set rs = Server.CreateOb ject("adodb.rec ordset")
'rs.Open "alte", strConnect, 1, 3
'rs.AddNew
' Use File.Binary to access binary data of uploaded file.
'rs("original_i mage1").Value = File.Binary
'Set ThumbFile1 = Upload.OpenFile (SavePath)
'rs("thumbnail1 ").Value = ThumbFile.Binar y
' Use File.Binary to access binary data of uploaded file.
'rs("original_i mage2").Value = File2.Binary
'Set ThumbFile2 = Upload.OpenFile (SavePath)
'rs("thumbnail2 ").Value = ThumbFile2.Bina ry

....
th both fields('origina l_image1 and 'original_image 2) upload only the first picture ! where is the mistake ?
thank you
dan
May 10 '07 #1
0 2806

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

Similar topics

32
3693
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 purchase an upload component. For someone who hates third party software and also does not want any kind of nonsense "bonus" features like progress bars...
5
7189
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 use any HTML form processing at all, i.e. <INPUT TYPE="FILE" etc...> processing. In actuality, I'm not using HTML at all. All is done with...
4
13182
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" ENCTYPE="multipart/form-data"....> <input type="checkbox" name="language" value="English">English <input type="checkbox" name="language" value="Spanish">Spanish...
0
4742
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 verdiği hata şu.Bilen arkadaşlar lütfen yardım edin Persits.Upload.1 error '800a0020' The system cannot find the path specified. ...
1
8414
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 folder (it does) then upload the file to that folder and this is where the problem comes in. The file is written to the parent directory, not the...
4
2356
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 description and a filename, like this ... <FORM METHOD="POST" ACTION="sl_upload2.asp" ENCTYPE="multipart/form-data"> <TABLE> <tr><td>Document...
0
2602
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 my upload.savevirtual : Set Upload = Server.CreateObject("Persits.Upload") upload.savevirtual ("test/") .. ''''error:
1
10470
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 my upload.savevirtual : Set Upload = Server.CreateObject("Persits.Upload") upload.savevirtual ("test/") .. ''''error:
1
5707
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 this is my codes, Set Upload = Server.CreateObject("Persits.Upload.1") Count = Upload.Save("d:\cmsupload\cimg\") for each File in upload.Files...
0
7664
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7885
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.