Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Apr 18th, 2008, 3:59 PM   #1
brokenhope
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 126
Rep Power: 4 brokenhope is on a distinguished road
PHP Uploader, Aiming for safety.

I have added an uploader to my website. It is a simple multi file uploader.

I want to keep adding features to it, but one thing stumps me, the security.

When a user chooses a file(s) to upload, it is uploaded in a specified subdirectory within the upload directory, under its original file name. That is one thing I need to do something with, so far my script checks:

-Checks if a file with that filename already exists, if so it added a numerical prefix to the file name.
-Checks if the format is valid, I only block .exe formats at this moment.
-Checks if the format is a "convert to .txt" format, which includes: html, xhtml, css, js, php, php3, php4, php5, xml, etc

and otherwise the file is uploaded with its original file name as is. Anyone have some pointers on some security I can add, as in checking the file name, invalid characters in a file name, etc...


Next is the specified upload directory, I know they can somehow reach other directorys with slashes and periods or something, how would I go about making sure the specified directory is only valid alpha numeric characters?

Same goes for the create directory function, I can only have them entering alpha numeric characters.

Thank you for reading, I am a bit rusty at PHP lately, just picked up on my project after nearly a year break from it.
brokenhope is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP, how to do this? bulio PHP 3 Feb 18th, 2008 8:01 AM
installing php (beginners question) spekkio7 PHP 4 Jan 11th, 2008 10:06 AM
Php with Sun Java System Application Server Platform lucifer PHP 0 Jun 7th, 2007 4:03 AM
Php Tutorial 3 bulio PHP 4 Jul 16th, 2006 4:00 AM
Php Tutorial 1 bulio PHP 17 May 29th, 2006 4:54 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC