|
[VBScript]
Set xf = Server.CreateObject("ABCUpload4.XForm")
Set ca = Server.CreateObject("ImageGlue6.Canvas")
Set fl = xf("filefield")(1)
params = "Fit=True VAlign=middle HAlign=middle"
ca.Width = 300 ' constrain width
ca.DrawData fl.Data, fl.FileName, params
ca.SaveAs Server.MapPath("upload.jpg"), ""
The above takes a graphic file uploaded using an html upload. It
constrains the width of the graphic and draws the data onto a canvas.
Finally it saves the image out as a jpeg into the virtual directory
of the web server.The following is an example of the html needed
for the submitting form.
[VBScript]
<form method="post" action="upload.asp"
name="submit" enctype="multipart/form-data">
Choose a file to upload:<br>
<input type="file" name="filefield"
size="40"><br>
<input type="submit" name="submit"
value="submit"><br>
</form>
|