Using SaveVirtual and SaveAsVirtual to differnet directories
Posted on 2006-07-12
I am trying to upload two images from the same form to two different directories. My host requires that I use SaveVirtual and SaveAsVirtual.
I want the name of the file to be changes to the serial ID of the item that is being uploaded to the database (hence 'Name = "/"&pro_id&".jpg"')
It does work and upload the files to the correct directories with the correct filenames.
The problem: It also uploads the origional image files in the /images/ folder.
How can I produce the same result without uploading the origional images?
Here is the code I have:
Set Upload = Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual("/images/")
<% = Count %> files uploaded.
Set File1 = Upload.Files("filesmall")
Set File2 = Upload.Files("filebig")
Name = "/"&pro_id&".jpg"
If Not File1 Is Nothing Then File1.SaveAsVirtual "/images/products_small" & Name
If Not File2 Is Nothing Then File2.SaveAsVirtual "/images/products_big" & Name