In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "jspXCMS how to upload files to a directory outside the program". In daily operation, I believe many people have doubts about how jspXCMS put uploaded files into directories outside the program. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how jspXCMS puts uploaded files into directories outside the program". Next, please follow the editor to study!
Because when the program is updated or upgraded, you need to keep the uploaded files (usually the / uploads folder). Sometimes you want to save the uploaded file to a directory outside the program so that it won't be overwritten when updating the program.
To achieve this function, two problems need to be solved: one is to put the / uploads folder outside the program to be accessible by the browser; the other is to save the file to the specified folder when uploading.
Modify tomcat configuration
Modify the Host and Context configuration in the server.xml of tomcat to make the / uploads folder accessible outside the program.
Modify weblogic configuration (not applicable for now)
This method does not support image plus parameters, such as / uploads/abc.jpg can be accessed, / uploads/abc.jpg?d=123 cannot be accessed. This may be the bug of weblogic and may be fixed in a future version, so leave this method here as well.
Modify / WEB-INF/weblogic.xml file
... / home/weblogic/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/webshare/jspxcms / uploads/*...
Note here that accessing / uploads/abc.jpg is visiting... / webshare/jspxcms/uploads/abc.jpg, not... / webshare/jspxcms/abc.jpg. So pay extra attention to the configuration.
WebLogic deploys uploads applications
The above method of using virtual-directory is flawed and not available. Therefore, it is necessary to deploy a uploads application.
The uploads application is simple and deployed at / home/weblogic/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/webapps/uploads.
Only one / WEB-INF/weblogic.xml is needed, which is as follows:
/ uploads modify attachment publishing point
The commercial version of the release point function allows you to save uploaded files to a specified folder.
Click the background navigation system management-publishing point to modify the attachment default publishing point.
Change the save path to the specified folder, such as: file:D:/other/dir/uploads (the linux system does not need a drive letter, such as file:/mydata/dir/uploads). Note file: prefix, followed by absolute path, path division symbol with /. Without this prefix, the program root is used as the starting path.
At this point, the study on "how jspXCMS puts uploaded files in a directory outside the program" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.