Link to home
Start Free TrialLog in
Avatar of Edwin Martinez
Edwin Martinez

asked on

Helpme with Persist AspUpload and AspJpeg to save and resize an image

I am trying to upload a single file using the AspUpload, to save one image as part of a form with various fields. The ASP portion of the AspUpload its at the end of the execution to be able to get the form field values.

ASP:

      Set Upload = Server.CreateObject("Persits.Upload")
      ' Use AspJpeg to resize image
      Set Jpeg = Server.CreateObject("Persits.Jpeg")
      Upload.Save Server.MapPath("\upload")

            If File.ImageType <> "JPG" Then
                  File.Delete
                  Response.End
            End If
            
            Jpeg.Open (File.Path)
            newWidth = 640
            newHeight = newWidth * Jpeg.OriginalHeight / Jpeg.OriginalWidth

            Jpeg.Width = newWidth
            Jpeg.Height = newHeight
            Jpeg.Quality = 80
            Jpeg.RotateR
            Jpeg.Save Server.MapPath("\upload") & File.ExtractFileName
            varFilename = File.ExtractFileName

Problem:
Image no being resized
Avatar of Kumaraswamy R
Kumaraswamy R
Flag of India image

Hi

AspUpload is capable of determining the type and pixel size of uploaded images.
The formats currently supported are GIF, JPEG, BMP and PNG. The type and size information is returned via the propertie

File.ImageType, File.ImageWidth, and File.ImageHeight.
Refer : User guide for aspupload and aspjpeg

http://www.aspupload.com/manual_image.html
http://www.aspjpeg.com/manual_02.html

Addition : same issue faced by other developer
http://forums.redfoxhosting.com/threads/6094-aspupload-and-aspjpeg-not-resizing-image-on-upload
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.