<%@ Language=VBScript %> <% ' This script is called by the applet while the user presses the "Save" button. ' It saves the resulting image to a file and asks the applet to open the 'view.asp' ' in a new window to prove that the image is saved successfully. ' ' Upload notes: ' ' 1. The script uses an upload processing code (upload.asp) which requires VBScript v5.0 ' installed on your web server. Usually it comes to your computer with IE 5.0 or later. ' ' 2. You can use any other upload processing components to accept the image from the applet. ' In that case you have to rewrite this script specifically to the component you're using. ' ' Create the FileUploader component Set Uploader = New FileUploader ' Start the upload processing Uploader.Upload() ' Check if the image file has been actually uploaded If Uploader.Files.Count > 0 Then ' The script uses the file name specified by the applet, ' but you can assign any desirable file name, for example: ' Uploader.Files("image").FileName = "myname.jpg" ' The script saves the image files to the script's directory; SaveDir = "f:\tempsave" ' but you can set any destination directory, for example: ' SaveDir = "D:\images\" ' Do the save action Uploader.Files("image").SaveToDisk SaveDir ' Ask the applet to redirect user's browser to the view.asp page Response.Write "#SETDOCTAG=_blank" & vbCRLF Response.Write "#SHOWDOCUMENT=view.asp?FileName=" & Server.URLEncode(Uploader.Files("image").FileName) & vbCRLF Else ' no uploaded image is found in the request Response.Write "#SHOWERROR=Image is not found." End If %>