In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "nginx file download designated save file name how to configure", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "nginx file download specified save file name how to configure" it!
Usually, after we upload the resource file, in order to avoid file name conflict, the file name will be changed to a meaningless paragraph of characters. This character may be generated by md5 or a string generated in some other way. At this point, when downloading, the default saved file name will be this meaningless file name (figure 1).
In fact, nginx supports renaming when downloading, making the file name more friendly.
Nginx is also easy to configure: just add the following lines:
The copy code is as follows:
Location *. *\. (doc | txt | jar | zip | apk) (\?. *)? $
{
If ($request_uri ~ * ^. * / (. *). (doc | txt | jar | zip | apk) (\? n = ([^ &] +)) $) {
Add_header content-disposition "attachment;filename=$arg_n.$2"
}
Log_not_found off
Expires 30d
Break
}
The if line is more critical. When configured in this way, when the n parameter is not passed, it will be saved by the original name. There are no empty names.
Because it is specified in the form of header, cdn will save this header information and will behave the same way when the content is distributed.
Thank you for your reading, the above is the "nginx file download specified save file name how to configure" the content, after the study of this article, I believe that you download the nginx file download specified save file name how to configure this problem has a deeper understanding, the specific use of the need for you to practice verification. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.