walker5595 Posted February 9, 2012 Share Posted February 9, 2012 Hey, I am looking for an ecommerce system or just the way how to achieve the following. I am wanting to store some MP3 sound files in a folder called for example 'sounds' on my web server. I then want to be able to stream the files onto my web pages but then I also want people to be able to purchase them. This is where I get confused, how can I achieve this without letting people just be able to download the 'sounds' directory off my web server. I am wanting to do this using PHP obviously. Thanks in advance for help Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/ Share on other sites More sharing options...
scootstah Posted February 9, 2012 Share Posted February 9, 2012 If you allow people to stream it, you allow people to save it. You can prevent them from directly accessing the files by using an .htaccess rule on the directory. deny from all Save that code as .htaccess and stick it in the "sounds" directory, and people will no longer be able to navigate to it. However they will still be able to save the files from the stream, but there's nothing you can do about that. Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316229 Share on other sites More sharing options...
walker5595 Posted February 9, 2012 Author Share Posted February 9, 2012 Hey thanks for the reply. Only problem is this way doesn't allow users any way shape or form to even stream the media to my web page Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316238 Share on other sites More sharing options...
scootstah Posted February 9, 2012 Share Posted February 9, 2012 How are you trying to stream it? Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316241 Share on other sites More sharing options...
walker5595 Posted February 9, 2012 Author Share Posted February 9, 2012 At this moment and time I am not 100% sure how I am going to stream. To test this out I was just using the HTML5 audio tag. In the end I want to use some sort of HTML script that doesn't leave the URL open in the source code, something similar to the player found at www.soundowl.com Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316246 Share on other sites More sharing options...
walker5595 Posted February 9, 2012 Author Share Posted February 9, 2012 just figured out WHAT I want, just don't know how to achieve it now. I need the MP3 files to be stored in a folder for example called 'sounds'. If someone directs to /sounds/ they need to be directed to homepage. Then if someone uses a program like WinHTTrack the files won't be downloaded. But then if someone goes to the direct URL such as /sounds/sound1.mp3 then the file will be downloaded. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316252 Share on other sites More sharing options...
scootstah Posted February 9, 2012 Share Posted February 9, 2012 You can use a .htaccess rule to redirect traffic that goes to /sounds. Or, you can use Options -Indexes to make it so if someone browses to /sounds, they won't be able to view the contents of the directory (alternatively you can just stick a blank index.html file in it). However there's not really any way to stop something like HTTrack. If you simply guess the file name you could download it. If you want it so they can only download a file once they buy it, you could hide the files in a directory that isn't accessible to the public (like outside the docroot) and then use PHP to serve the file as a download. See here for how to do that. In this way, users wouldn't be able to see where the files come from. Like I said though, you can't stop people from downloading the files freely if you allow streaming. For example that soundowl site, I can download all the MP3's in mere seconds with no problems. Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316258 Share on other sites More sharing options...
walker5595 Posted February 9, 2012 Author Share Posted February 9, 2012 How does soundowl achieve not able to download every file using that program. All the files are stored on dl.soundowl.com but using that program on that URL does not download all files? Because if I hide all the files if someone does come across where they are stored then they have access to ALL of them Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316264 Share on other sites More sharing options...
walker5595 Posted February 9, 2012 Author Share Posted February 9, 2012 nevermind my last post! I've found it on the link you gave me! Thank you so much for your help just what I was looking for! Quote Link to comment https://forums.phpfreaks.com/topic/256756-some-sort-of-ecommerce-system-help-needed/#findComment-1316268 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.