📄 save.aspx
字号:
<%@ Page Language="C#" %>
<%
/*----------------------------------------------------------------------------
' 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.
'----------------------------------------------------------------------------*/
// let's save images to the script's directory
string filePath = Server.MapPath("./");
HttpFileCollection postedFileCollection = Request.Files;
if (postedFileCollection.Count > 0) {
HttpPostedFile postedFile = Request.Files[0];
// we use here the file name suggested by the applet
string fileName = postedFile.FileName.Substring(postedFile.FileName.LastIndexOf("\\")+1);
// but you can use any naming strategy, for example:
// fileName = "XYZ12345.PNG";
// save the uploaded image
postedFile.SaveAs(filePath+"\\"+fileName);
// Ask the applet to redirect the user's browser to the 'view.aspx' page
Response.Write("#SHOWDOCUMENT=view.aspx?filename=" + fileName + "\n");
}
else {
// No file has been uploaded
// Ask the applet to report the error to the browser's status line
Response.Write("#SHOWSTATUS=No file has been uploaded\n");
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -