V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
coffeeing
V2EX  ›  程序员

咨询网页下载文件获取文件名和文件大小出错问题 Content-Disposition: attachment

  •  
  •   coffeeing · Nov 7, 2022 · 1150 views
    This topic created in 1277 days ago, the information mentioned may be changed or developed.

    在微信里打开网页能下载视频,但是不能正确获取到文件名和文件大小,麻烦哪位技术大咖帮我看看怎么改,谢谢谢谢

    <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 > 下载测试 </body> </html>

    avatar avatar

    ysc3839
        1
    ysc3839  
       Nov 8, 2022 via Android
    Content-Disposition 要放在 HTTP 响应里面
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2799 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 15:44 · PVG 23:44 · LAX 08:44 · JFK 11:44
    ♥ Do have faith in what you're doing.