coffeeing 最近的时间轴更新
请教各位大佬,想在微信里打开的网页下载视频文件,点击下载后,下载的文件没有后缀.mp4,麻烦大家帮我看看,谢谢
<html>
<head>
<meta Content-Type="application/octet-stream" >
<meta Content-Disposition="attachment;filename=xxxx;filename*=UTF-8''xxxxxx">
<meta X-Content-Type-Options="nosniff">
<meta charset="ut
</head>
<body >
<a href="https://www.xxx.com/abc.mp4?attachment" target="_blank" data-url="https://www.xxx.com/abc.mp4?attachment" download="https://www.xxx.com/abc.mp4?attachment" style="font-size:24px" >下载</a>
</body>
</html>
2022-11-01 20:24:32 +08:00
coffeeing

coffeeing

V2EX 第 599103 号会员,加入于 2022-10-26 17:13:21 +08:00
coffeeing 最近回复了
2022-12-05 10:42:54 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
@hua123s 不好意思,打扰下,能否加下 UVE6MTgyMDExMDkxMg== ( base64 )指导下,非常感谢。
2022-12-01 11:50:11 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
@wangsongyan 加了,非常感谢
2022-12-01 11:40:44 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
我加了对应的服务端配置代码,打开下载是这样,文件没有识别出来,文件大小是 0B ,选择用其他应用打开看到的文件名是这样: https___www.solaredufn.com_upload_download_56954

<img decoding="async" src=" " width="50%">
2022-12-01 10:01:45 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
@zhangdashuan 麻烦有没有对应的代码贴下,我学习下,谢谢谢谢
2022-12-01 10:00:23 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
@hua123s 昨晚后端写了,我测试下来没有解决大小和文件名,再麻烦看下是这样写么?

location / {
if (!-e $request_filename){
rewrite “(.*)$ /index.php?s-$1 last;break;
add header Content-Disposition "attachment; filename=$basename"
add header Content-Type "application/octet-stream";
}
}

map $uri $basename {
~/(?<captured basename>[~/]*)$ $captured basename;
}
server
{
listen 80:
2022-11-30 16:06:15 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
@Jasio 麻烦问下,这段代码是加在 Untitled-2.html 页面里,还是加在哪里?
2022-11-30 16:06:09 +08:00
回复了 coffeeing 创建的主题 程序员 200 元在线跪求服务端配置问题,解决网页能下载视频!
@hua123s 麻烦问下,这段代码是加在 Untitled-2.html 页面里,还是加在哪里?
@HariopaNic 感谢感谢,我转给后端同学看看,我目前做的是直接写在 html 里,但是下载后不显示文件名,文件大小。。。。。

<html>
<head>
<meta Content-Type="application/octet-stream" >
<meta Content-Disposition="attachment;filename=$encoded_fname;filename*=utf-8''$encoded_fname">
<meta X-Content-Type-Options="nosniff">
<meta charset="utf-8">
</head>
<body >
<a href="https://www.solaredufn.com/upload/download/56954.mp4" target="_blank" data-url="https://www.solaredufn.com/upload/download/56954.mp4" download="https://www.solaredufn.com/upload/download/56954.mp4" style="font-size:24px" >下载测试</a>
</body>
</html>
2022-11-07 15:15:46 +08:00
回复了 anzu 创建的主题 Python 正确填写与获取下载文件名
@Kobayashi "attachment; filename*=utf-8''{}".format(quote(filename))
打扰,麻烦问下,这个代码是写在 http 的 head 里,还是服务端的配置文件里?谢谢谢谢
@Kei001 不管怎样,还是得感谢指导
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4568 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 19ms · UTC 09:56 · PVG 17:56 · LAX 02:56 · JFK 05:56
Developed with CodeLauncher
♥ Do have faith in what you're doing.