Jump to content
xisto Community
Sign in to follow this  
iGuest

PHP Upload script

Recommended Posts

<?if ($_POST["action"]=="upload"){        $file=$HTTP_POST_FILES["file"];        $tmp_name=$file["tmp_name"];	$new_name="./path/to/some/folder/".$file["name"];        move_uploaded_file($tmp_name, $new_name);}?><form enctype="multipart/form-data" action="<? echo $_SERVER["PHP_SELF"]; ?>" method="post">Choose a file:<input type="file" name="file" /><input type="hidden" name="MAX_FILE_SIZE" value="1048576" /><br /><input type="hidden" name="action" value="upload" /><input type="submit" name="submit" value="Upload!" /></form>

Share this post


Link to post
Share on other sites

any ideas on how i can upload files bigger than 2mb (ie. 5)? is this blocked by php or FNH? would i have to try asp or something? i cant use ftp but am willing to try anything :D

Share this post


Link to post
Share on other sites

any ideas on how i can upload files bigger than 2mb (ie. 5)? is this blocked by php or FNH?

Run a "phpinfo();" command and see for yourself...

upload_max_filesize 2M

:roll:

Share this post


Link to post
Share on other sites

well tbh i have no php programming knowledge at all :D - didnt even know that existed lol. so er.... a setting by FNH or a php limitation? (ty for your patience with the n00bs :D)

Share this post


Link to post
Share on other sites

well tbh i have no php programming knowledge at all :D - didnt even know that existed lol. so er.... a setting by FNH or a php limitation? (ty for your patience with the n00bs :D)

No problem :Da php configuration setting, set by FNH :D

Share this post


Link to post
Share on other sites

thanks for the script, i will check it out as well, are there any insecurities for a website if it uses this upload script?

Well, there won't be if you won't ANYONE let EVER know what is the path to this script. It has no security check, so ANYONE could upload you some malicious script (e.g. in php) and do some not very nice stuff to your site...:twisted:So don't put it like "yourname.freenukehosting.com/upload.php", nor "/upload/" and nothing that can be guessed at all...
And still, I wouldn't rely on it... get a more sophisticated script if you really need to use file uploads, something that has at least a password check.
It's your decision...your responsibility...but it could have consequences for all of us (remember the last time someone was found illegal files on their account? :roll: )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.