Author | Post | ||
sniperkid |
Anyone know a secure php script which can upload things (music only), secure as in only accepts certain files and can check to see if they are music (ie. no exploit scripts that, when run, maybe virus' or anything) |
||
18.07.2006 06:21:39 |
|
||
unstable |
A good source for php scripts as well as for all kinds of source code in a variety of different programming languages is planetsourcecode.com. You can easily search by keywords and programming language in the database, or browse the categories by programming language. It has just about everything. It’s also not that hard to code it yourself. Last year at school, me and some classmates coded a simple file upload script as part of an auction site-project which only accepts image files. We only filtered by file extention though, if you would want to check the header of the files to verify it’s filetype, it would be a bit more tricky since you’d have to store a lot of file signatures and implement some sort of file scanner. Maybe you can use some database files from some sort of “filetype scanner” software. Or maybe you can even find some ready made scripts for it on planetsourcecode. Imho, it’s not really necessary though, since if you only accept files with file extentions that are only used for music evil scripts can’t execute anyways. Regards, unstable |
||
18.07.2006 07:02:15 |
|
||
Gome |
You should also check MIME, not that it can't be changed, but when is anything safe at all. |
||
18.07.2006 07:44:52 |
|
||
beerhunter |
Checking the extension and PHP's mime_content_type should be enough. |
||
18.07.2006 08:06:25 |
|