jimath Posted February 27, 2007 Share Posted February 27, 2007 hello everyone! i have an icon corresponded to a wav file. <a href="file.wav"><img src="icon.gif" width="20" height="20" alt=".wav File"></a> i d like your help on how i could allow my users to be able to download the file (if their browser allow it) could this be achived using html? Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/ Share on other sites More sharing options...
fenway Posted February 27, 2007 Share Posted February 27, 2007 You mean serve the file? Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/#findComment-195577 Share on other sites More sharing options...
lando Posted February 28, 2007 Share Posted February 28, 2007 The way you have it setup now you would have to have them right click and select 'save-as'. If you want to force them to download it instead you could use a scripting language to set a header like PHP or use htaccess. Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/#findComment-195775 Share on other sites More sharing options...
jimath Posted February 28, 2007 Author Share Posted February 28, 2007 You mean serve the file? when the users click on the icon, i want a window being displayed for the users to be able to save it on their computers. could you help me? Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/#findComment-196164 Share on other sites More sharing options...
lando Posted February 28, 2007 Share Posted February 28, 2007 I provided two links in my post that will tell you exactly how to do it, depending on which method you feel more comfortable with. Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/#findComment-196168 Share on other sites More sharing options...
jimath Posted February 28, 2007 Author Share Posted February 28, 2007 ok thank you. but sth else. my file is a wav file. i simply want an icon instead of a link to correspond to it. so , now if the user right click and save, download the icon, not the wav file. Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/#findComment-196181 Share on other sites More sharing options...
lando Posted February 28, 2007 Share Posted February 28, 2007 True. If they select save-as it will save the image, if they select save link then it will download the .wav file. The other two methods I mentioned would be more fail proof. Link to comment https://forums.phpfreaks.com/topic/40409-how-to-allow-users-to-download-a-file/#findComment-196183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.