I am new to PHP. I have a software downloads website. What I want is to
automatically add “-mysite.com” with every download filename. So that the actual
filename remain the same i.e “somesoftware.exe” but whenever someone download it, it should
be automatically renamed and downloaded with the filename “somesoftware-
mysitename.com.exe” to their computer. Here is the code for download link div on my site.
<!--===========================Download Div===============================-->
<div id="downlink-container">
<a href="http://www.mysitename.com/downloads/jetaudio16.0.0.435-mysitename.com.exe" id="downloadlink" style="visibility:visible">
Download Jet Audio
</a>
</div>
<!--===========================Download Div====================================-->
Can I use PHP to automatically add “-mysitename.com” with the downloaded file name
“somesoftware.exe” so that the actual filename on server folder remain the same(i.e.
somesoftware.exe) but whenever someone download it, it automatically become “somesoftware-
mysitename.com.exe”. I tried using PHP variables for this but I can’t get it done. Please
Help!
You set the following header:
Where
downloaded.pdfis your filename. Its just a matter of getting the extention and adding “- thenoblesite.com” to the original name.