I did this several years ago in ASP code using a couple tools provided by Persits. AspUpload and ASPJPeG. These are a couple of objects that seem to support uploading of files or images very well. The ASPJPEG object worked great for dynamic resizing of those images.
Below is a piece of sample code using these objects.
<%
dim i
dim Session_ID, User_ID, User_Name, Study_ID, Schema_ID, Compile, Page
dim FolderList, DocCategory, DocumentLoaded, ReturnDocURL
'Default this value
DocumentLoaded = "False"
Dim sResult
Dim Upload
Dim Count
Dim File
Dim LocalDocPath
Dim UniqueID
Dim Jpeg
Dim Path
sResult = "NONE"
UniqueID = Request.QueryString("UniqueID")
If Request.QueryString("DocUpload") = "True" Then
sResult = "Local Upload"
Set Upload = Server.CreateObject("Persits.Upload.1")
' Optional: make sure file names are unique when calling File.SaveAs
Upload.OverwriteFiles = True
Count = Upload.SaveToMemory
If Count > 0 Then ' 1 file uploaded
Set File = Upload.Files(1)
' Side effect: SaveAs sets changes File.Path property to a new value.
TempDocPath = cstr(Session("AutoImage") & "\" & cstr(UniqueID) & "_Orig.jpg")
File.SaveAs cstr(TempDocPath)
DocumentLoaded = "True"
' Create an instance of AspJpeg
Set Jpeg = Server.CreateObject("Persits.Jpeg")
' Compute path to source image
Path = cstr(Session("AutoImage") & "\" & cstr(UniqueID) & "_Orig.jpg")
' Open source image
Jpeg.Open Path
' Create popup page larger picture
Jpeg.Width = 700
Jpeg.Height = jpeg.OriginalHeight * jpeg.Width / jpeg.OriginalWidth
' Optional: apply sharpening
Jpeg.Sharpen 1, 150
' Create thumbnail and save it to disk
Jpeg.Save cstr(Session("AutoImage") & "\" & cstr(UniqueID) & ".jpg")
' Create Detail page picture
Jpeg.Width = 289
Jpeg.Height = jpeg.OriginalHeight * jpeg.Width / jpeg.OriginalWidth
' Optional: apply sharpening
Jpeg.Sharpen 1, 150
' Create thumbnail and save it to disk
Jpeg.Save cstr(Session("AutoImage") & "\" & cstr(UniqueID) & "_med.jpg")
' Create Thumbnail
Jpeg.Width = 100
Jpeg.Height = jpeg.OriginalHeight * jpeg.Width / jpeg.OriginalWidth
' Optional: apply sharpening
Jpeg.Sharpen 1, 150
' Create thumbnail and save it to disk
Jpeg.Save cstr(Session("AutoImage") & "\" & cstr(UniqueID) & "_small.jpg")
on error resume next
Set Upload = Nothing
Set Jpeg = Nothing
Else
sResult = "No files found for uploaded."
End If
End If
%>
Please submit any questions or comments through my website.
http://www.qualitysoftwaredesign.com