Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP FAQs
|
PHP FAQs This moderated forum is where our PHP experts answer some of the questions they see asked most frequently in the other PHP forums. You cannot post other messages here, use the other PHP forums for that.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP FAQs section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2011, 03:32 PM
Authorized User
 
Join Date: Jan 2011
Posts: 11
Thanks: 4
Thanked 0 Times in 0 Posts
Default "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
 
Old November 20th, 2011, 12:32 AM
Authorized User
 
Join Date: Jan 2011
Posts: 11
Thanks: 4
Thanked 0 Times in 0 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to upload mp3 file using php abhi.sharma05 PHP How-To 4 November 1st, 2011 11:59 PM
mak upload file secure for public usage crmpicco PHP How-To 0 October 22nd, 2007 03:04 PM
PHP file upload qazi_nomi PHP How-To 2 July 11th, 2004 10:43 PM
php file upload reason1000 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 June 7th, 2003 10:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.