doulangchao8934 2009-12-20 22:58
浏览 51
已采纳

带有CDN的远程服务器的标头

I have a CDN that is storing media files. Each file I want to store as just the ID number of the file in the data so, file.zip = 4423342 on the server. The problem is, the CDN does not allow php or any form of programming. How can I make it so I have a local file that is used to set the headers and let me change it so when they download a file from the CDN it downloads as file.zip instead of 4423342. Now I know this is simple if the file is stored on the same server as the file that sets the headers.

Thanks!

  • 写回答

1条回答 默认 最新

  • dongpao5261 2009-12-20 23:12
    关注

    If your CDN doesn't allow you to set the name/headers of the stored file, you cannot do it on your server. The user gets directed to the CDN server, and you can't "inject" anything into that connection.

    I would look into looking up the options your CDN does offer. For example, you might be able to append something like /file.zip to the end of the CDN url, and still get the correct file.

    That is – if the CDN url is http://cdn.example.com/113312, maybe http://cdn.example.com/113312/file.zip works as well.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?