ASPImage ; saving two images with one upload

Discussion in 'Classic ASP' started by alihamed, Nov 5, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    The problem:

    I have a page where I allow users to upload an image. I perform the upload using ASPUpload code (which discountASP.net provides as well). After the upload, this ASPUpload component provides a path to an image where I now use ASPImage to perform some resizing and then re-save the file. However, what I want to do two separate re-sizing. Meaning, I like to re-size the image to 260 x 180 and also re-size the image to 70 x 60 and then save the image as two separate images. Essentially, taking the path and filename that ASPUpload provides and create two objects of the ASPImage and then do the separate resizing and save the separate images into separate directories with the same original file.


    The Question:


    What is the exact code I need for ASPImage to create two objects of an image from the same file name and path that I provide, perform my resizing of the images (one will be 260 x 180 and the other being a thumbnail will be 70 x 60) and then save each individual image with the same file name, but into two separate directories, different from the original directory? I appreciate your help with this; Please write the code knowing that ASPUpload will provide a path name, but obviously, you don?t need to write the code for the ASPupload component.



    Thanks,

    Ali
     
  2. Just re-think the order in which you need to perform the steps.

    Try this:
    1. save the image to disk (using the File System Object)
    2. open the image (using FSO), resize it (using ASPImage) and save it in one folder
    3. open the image again, resize it (to a different size) and save it to another folder

    -Kim
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page