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? Quote 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? Quote 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. Quote 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? Quote 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. Quote 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. Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.