p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   PHP FAQs (http://p2p.wrox.com/php-faqs-124/)
-   -   "Secure" MP3 Upload via PHP (http://p2p.wrox.com/php-faqs/85090-secure-mp3-upload-via-php.html)

wiswif September 19th, 2011 03:32 PM

"Secure" MP3 Upload via PHP
 
Hello wrox,
I've done many a search on the topic without any real solution, so I thought I would ask the experts from whom I've learned so much.

I have a script for embedding an MP3 player on a particular website that plays files from a given directory on the site. I'd like to give users the ability to upload their files (this site centers around original music, if anyone is starting to sweat) but worry about giving people such unchecked access... without any good alternative, I have long since figured I would have them upload to a directory no one else can access and I would simply test them file by file to ensure that they are at the very least in fact MP3s... hardly "secure". If anyone has any better ideas, I would love to hear some input.

Thanks,
wiswif

wiswif November 19th, 2011 11:32 PM

In a serendipitous encounter with an experienced programmer (at a bar), I learned that the question I ask has no easy solution; what he suggested, in fact, was what I have long resolved to doing, which is

1) ensuring the files are uploaded to a private directory, unable to be accessed by anyone but myself and insulated (to the best extent possible) from the rest of the server in terms of malicious code, and
2) sorting through these files as they come in, 'approving' them on a case by case basis.

That being said, I was wondering if anyone could advise me on the best way to accomplish either part of this; if I remember from my "Beginning pHp" book, the former has to do with .htaccess, a realm with which I have no experience. In terms of the latter, if anyone has a better suggestion than trying to open each file on my personal computer, I would be more than happy to hear it.

Gratefully,
Peter Lynn
wiswif


All times are GMT -4. The time now is 12:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.