📄 save.asp
字号:
<%@ 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -