Jump to content

Changing filename of remote file


bananas

Recommended Posts

Hello, I'm using this code to change the filename of a remote file

 

header("Content-Disposition: attachment; filename=Vivaldi.ogg");
readfile("http://upload.wikimedia.org/wikipedia/commons/3/3c/01_-_Vivaldi_Spring_mvt_1_Allegro_-_John_Harrison_violin.ogg");

 

However, readfile uses up my server's bandwidth as well :(. Is there a way so that it just changes the name of the file in the download dialog, but directly downloads from the actual site? Thanks  :).

Link to comment
https://forums.phpfreaks.com/topic/79378-changing-filename-of-remote-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.