In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the example analysis of JSP background file management source code for you. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Found on the Internet to achieve JSP background file management, that is, the Web browser to achieve similar file management functions (more upload files). The source code is available, but it is a bit messy. After collation and improvement, the file download function is added, as well as the support for uploading large files (using commons.fileupload package to solve the problem that smartupload packets report errors when transferring large files). But I haven't changed the download yet (I have time to change it).
0) {fileDelF.delete (); response.sendRedirect (request.getRequestURI () + "? path=" + strDealPath+ "& act=show"); return;} else {strErr= "folder also contains files, please delete all the files and then delete the folder";}} else {strErr= "the folder to be deleted does not exist, please re-select" }} catch (Exception e) {strErr= "folder deletion error!" ;} else if (request.getParameter ("act") .equals ("renameFold")) {strStat= "renameFold" } else if (request.getParameter ("act"). Equals ("renameFoldDo") {/ / folder rename operation / / determine whether there is a change action for the folder name according to the parameter if (request.getParameter ("changeDo"). Equals ("true") {/ / has a file name, and the rename occurs try {String strFileRenameF=strDealPath+UnicodeToChinese (request.getParameter ("fold")) + "\\"; File fileRenameF=new File (strFileRenameF) / / first use strFileRenameF to get the current file path String strFileRenameToF=strDealPath+UnicodeToChinese (request.getParameter ("newFoldName")) + "\\"; File fileRenameToF=new File (strFileRenameToF); / / determine whether the renamed folder has if (fileRenameF.exists ()) {/ / determine whether the new folder name is the same as the existing folder if (! fileRenameToF.exists ()) {fileRenameF.renameTo (fileRenameToF) The folder name specified by response.sendRedirect (request.getRequestURI () + "? path=" + strDealPath+ "& act=show"); return;} else {strErr= "duplicates the existing folder name. Please re-specify a folder name!" ;} else {strErr= "the folder to be renamed does not exist, please re-select";}} catch (Exception e) {strErr= "folder rename error!" ;} else if (request.getParameter ("act") .equals ("renameFile") {strStat= "renameFile" } else if (request.getParameter ("act"). Equals ("renameFileDo") {/ / File rename operation / / determine whether there is a file name change action based on the parameters if (request.getParameter ("changeDo"). Equals ("true") {/ / there is a file name, try {String strFileRenameFi=strDealPath+UnicodeToChinese (request.getParameter ("file")); File fileRenameFi=new File (strFileRenameFi) String strFileRenameToFi=strDealPath+UnicodeToChinese (request.getParameter ("newFileName")); File fileRenameToFi=new File (strFileRenameToFi); / / determine whether the renamed file exists if (fileRenameFi.exists ()) {/ / determine whether the new file name is the same as the existing file name if (! fileRenameToFi.exists ()) {fileRenameFi.renameTo (fileRenameToFi); response.sendRedirect (request.getRequestURI () + "? path=" + strDealPath+ "& act=show"); return } else {strErr= "the specified file name is duplicate with the existing file name, please re-specify a file name!" ;} else {strErr= "the file to be renamed does not exist, please re-select";}} catch (Exception e) {strErr= "File rename error!" ;}} else if (request.getParameter ("act"). Equals ("delFileDo") {/ / delete operation try {String strFileDelFi=strDealPath+UnicodeToChinese (request.getParameter ("file")); File fileDelFi=new File (strFileDelFi); if (fileDelFi.exists ()) {fileDelFi.delete (); response.sendRedirect (request.getRequestURI () + "? path=" + strDealPath+ "& act=show"); return } else {strErr= "the file to be deleted does not exist, please reselect";}} catch (Exception e) {strErr= "File deletion error!" ;}} / / upload files using smartupload component else if (request.getParameter ("act") .equals ("uploadFile")) {strStat= "uploadFile" } else if (request.getParameter ("act"). Equals ("uploadFileDo") {% > this article ends here. I hope the above content can be helpful to you, so that you can learn more knowledge. If you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.