A PHP script to let users download a file from my website without revealing the actual file link in my website?

后端 未结 4 1691
暖寄归人
暖寄归人 2020-11-30 09:19

The question says it all.. How do I let the users download a file from my website and not let them see what link that file comes from? I understand that the

4条回答
  •  猫巷女王i
    2020-11-30 10:13

    You can't make someone download a file from a URL without letting them know the URL. It's not possible under the HTTP specification. Anything downloaded has a URL.

    You can, however, have a download URL that only works once, or requires some specific information to be passed via the POST method. You check for a token in the GET or POST variables and invalidate that token once it's used once.

提交回复
热议问题