Topic: "Uploading..." (page 1 of 1)

1
Author Post
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
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) ;)

private message Website
unstable
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
A good source for php scripts as well as for all kinds of source code in a variety of different programming languages is linkplanetsourcecode.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
private message EMail
Gome
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
You should also check MIME, not that it can't be changed, but when is anything safe at all. :)
private message
beerhunter
groupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Checking the extension and PHP's linkmime_content_type should be enough.
private message EMail

Topic: "Uploading..." (page 1 of 1)

1