save.asp
来自「applet在線上繪圖,允許在瀏覽器上繪圖,最後儲存成各式的圖檔」· ASP 代码 · 共 48 行
ASP
48 行
<%@ Language=VBScript %>
<!-- #include file="upload.asp" -->
<%
'-----------------------------------------------------------------------------------------------
' This script accepts the image from the editor and saves it to a disk file.
' Then it asks the applet to redirect the browser to the 'view.asp'
' to prove that the image is saved successfully.
'
' A note on upload implementation:
'
' This script uses a pure ASP 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.
' But you can use any upload processing components to accept the image files from the editor.
' In that case you have to rewrite this script specifically to those component.
'-----------------------------------------------------------------------------------------------
' Create the FileUploader
Set Uploader = New FileUploader
' Start the upload process
Uploader.Upload()
' Check if any files were uploaded
If Uploader.Files.Count > 0 Then
' The script uses the file name specified by the editor,
' but you can assign any desirable file name to the image file.
'
' Uploader.Files("image").FileName = "myname.png"
' The script saves the image files to the script's directory;
' but you can set any destination directory, for example: SaveDir = "D:\images\"
'
SaveDir = Server.MapPath("./")
' Save image to the file
Uploader.Files("image").SaveToDisk SaveDir
' ASK THE APPLET to redirect the user's browser to the 'view.asp' page
Response.Write "#SHOWDOCUMENT=view.asp?filename=" & Uploader.Files("image").FileName & vbCRLF
Else
' Uploaded image is not found
Response.Write "#SHOWSTATUS=Image is not found."
End If
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?