Picture resizing script

Nathan

Perch
I currently use the aspSmartUpload.SmartUpload object so that my site visitors can upload their holiday snaps into my site gallery. I permit a max size of 30k per picture. Some members have problems resizing pictures. Is there a way of letting them upload a pic of any size (within reason) and then resizing then via the script before saving them to the server? I currently use the following code:
(Any advice very welcome - thanks.)

On Error Resume Next

' Variables
' *********
Dim mySmartUpload
Dim intCount

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "jpg"

' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp"

' Deny physical path
' *******************
mySmartUpload.DenyPhysicalPath = True

' Only allow files smaller than 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 40000

' Deny upload if the total fila size is greater than 200000 bytes
' ***************************************************************
mySmartUpload.TotalMaxFileSize = 200000

' Upload
' ******
mySmartUpload.Upload

' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/gallery/your holiday snaps/uploaded")
' sample with a physical path
' intCount = mySmartUpload.Save("c:\temp\")

' Trap errors
' ***********
If Err Then
Response.Write("<b>Incorrect File Type - Only JPG please : </b>" & Err.description)
Else
' Display the number of files uploaded
' ************************************
 
Back
Top