marinedalek Posted April 18, 2008 Share Posted April 18, 2008 Not sure if this is the right subforum, or indeed if this has been asked before because I can't find anything relevant in search. I'm looking to write a scrip to in effect rewrite the filename of a file upon download. The source file is in a link of type: http://somewhere.com/someoneelsesphpscript.php?id=23 which returns the file as having an htm extension, whereas I need it to arrive with an mp4 extension (the file is actually an mp4 file, just with an htm extension). The situation is that the files are to be streamed into Second Life for viewing inworld. To do this, SL requires a media URL which it then resolves into a file. Upon discovering the htm extension Second Life drops into HTML viewing mode and so doesn't render the file as a video. If however the file is downloaded and re-uploaded to a server with the extension changed to mp4, it streams perfectly. Sorry if this question's a bit of a mess! Quote Link to comment https://forums.phpfreaks.com/topic/101739-change-filename-of-linked-file-for-download/ Share on other sites More sharing options...
Daniel0 Posted April 18, 2008 Share Posted April 18, 2008 Send a header like this: Content-Disposition: attachment; filename=whatever.mp4 Quote Link to comment https://forums.phpfreaks.com/topic/101739-change-filename-of-linked-file-for-download/#findComment-520530 Share on other sites More sharing options...
marinedalek Posted April 18, 2008 Author Share Posted April 18, 2008 Thanks! I'll give that a try Quote Link to comment https://forums.phpfreaks.com/topic/101739-change-filename-of-linked-file-for-download/#findComment-520535 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.