PDA

View Full Version : Help with a upload script



MacOSXLeopard
20-12-2008, 04:16 PM
Hello,

I have an basic upload script and I was wondering if there was a way I could have something like an admin feature where I can control images from a page so if someone uploads an inaaprioate file onto my server then I can delete it without having to got through cpanel to delete it. I have forbid access to the /uploads/ dir for security reasons.

Thanks! :)

Jackboy
21-12-2008, 05:21 PM
http://www.softwareprojects.org/php-files-15.htm
http://www.w3schools.com/PHP/php_file.asp
http://www.schogini.com/articles/File-Handling-in-PHP.html

Havn't looked deeply at the links but i google "file handling + php".

If you learn that then sort out the permissions for your image directory then you will be able to delete the images via AdminCP.

Dentafrice
29-12-2008, 03:31 PM
This is a main reason I store information about my files in the database, filename, etc and provide it with an ID.

That way I can simply list all of the files from the database, pull the thumbnail/image.. then do my 'managing'.

To delete a file, simple do:



unlink( 'path/to/file.png' );


If the folder has the correct permissions then it should delete.

Listing the contents of a directory is something different.

If you need help with that also, post and I'll help.

hamheyelliot
04-01-2009, 05:22 PM
Strictly speaking, if it's a Free Basic Script, it may as well be a Free Script with an Admin function already there?

www.maianscriptworld.co.uk (http://www.maianscriptworld.co.uk) has one.

Or XtraUpload (http://webscripts.softpedia.com/script/File-Management-Perl/File-sharing/XtraUpload-30419.html) perhaps.

They're not chock-a-block with Security Features as far as I know; but if you're not much for coding one; well they'll make do perhaps?

Dentafrice
04-01-2009, 06:58 PM
Strictly speaking, if it's a Free Basic Script, it may as well be a Free Script with an Admin function already there?

www.maianscriptworld.co.uk (http://www.maianscriptworld.co.uk) has one.

Or XtraUpload (http://webscripts.softpedia.com/script/File-Management-Perl/File-sharing/XtraUpload-30419.html) perhaps.

They're not chock-a-block with Security Features as far as I know; but if you're not much for coding one; well they'll make do perhaps?
If it's not secure, then what's the point in using it? How will that 'do'?

hamheyelliot
04-01-2009, 07:48 PM
If it's not secure, then what's the point in using it? How will that 'do'?

Well I've no idea I'm afraid, they're most likely good scripts, but I can't be the judge.

Dentafrice
04-01-2009, 07:49 PM
I'm not saying that they are not good scripts, I'm just saying.. you said even if they had security issues, that they would probably 'do'?

hamheyelliot
04-01-2009, 08:12 PM
I didn't say they had any known issues, I said they wouldn't be as chock-a-block with security features as personally coded ones.

Want to hide these adverts? Register an account for free!