Other ASP Components/COM Objects
As well as the AspEmail and AspEncrypt
components covered in our e-mail tutorials
we also offer a number of other ASP components
that you can use within your site :
AspUpload allows you to easily upload files to your
hosting account using a normal HTML form. A simple example
of an the html form and upload script are shown below,
for more details on AspUpload please see the authors
web site : www.htmlupload.com.
Please note, as AspUpload is being used
within a shared environment the Upload.Save
method, which saves files using an absolute
path, is disabled. You must instead use
Upload.SaveVirtual which takes a virtual
path to the save location, this restricts
upload locations to your own web space only.
Example html form for file uploads :
<FORM METHOD="POST" ENCTYPE="multipart/form-data"
File 1:<INPUT TYPE=FILE NAME="FILE1">
File 2:<INPUT TYPE=FILE NAME="FILE2">
<INPUT TYPE=SUBMIT VALUE="Upload!">
Corresponding upload script that the upload
form posts to (process_upload.asp) :
Set Upload = Server.CreateObject("Persits.Upload.1")
For Each File in Upload.Files
Response.Write "File Uploaded Successfully
: " & File.Path & " "
& File.Size &" bytes"
AspJpeg allows you to modify images within
your web site with just a few lines of code.
Features include resizing, rotating, sharpening,
cropping, flipping and typing / drawing
over images. AspJpeg supports JPEG, PNG,
BMP and GIF image formats.
A sample AspJpeg sample script is shown below, for
full details of this component and full object reference
please visit the authors site : www.htmlupload.com/aspjpeg.html
' Create AspJpeg
Set Jpeg = Server.CreateObject("Persits.Jpeg")
' Set path to source
image, in this case an image called 'test.jpg'
in the same folder as the script
Path = Server.MapPath("images")
' Open source image
' Decrease image
size by 50%
Jpeg.Width = Jpeg.OriginalWidth / 2
Jpeg.Height = Jpeg.OriginalHeight / 2
' Optional: apply
Jpeg.Sharpen 1, 150
' Save modified
image to disk as 'test_small.jpg