iGuest 3 Report post Posted December 12, 2004 Does anyone know how i could use php to create a page where i can upload a file to a pre-defined folder on my accout? Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 12, 2004 <?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
iGuest 3 Report post Posted December 13, 2004 thanks man, this works perfectly Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 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 Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 Hey, post the link of where you have it, I wanna see it in action. Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 then anyone can write anything to my account.... :S does anyone have any idea for a solution? Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 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
iGuest 3 Report post Posted December 18, 2004 well tbh i have no php programming knowledge at all - didnt even know that existed lol. so er.... a setting by FNH or a php limitation? (ty for your patience with the n00bs ) Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 well tbh i have no php programming knowledge at all - didnt even know that existed lol. so er.... a setting by FNH or a php limitation? (ty for your patience with the n00bs )No problem :Da php configuration setting, set by FNH Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 k thx, ill go hunt around for an asp version Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 20, 2004 I need one for a PHPBB forum....and ezportal.....with subblack theme..(FI) Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 20, 2004 thanks for the script, i will check it out as well, are there any insecurities for a website if it uses this upload script? Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 20, 2004 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
iGuest 3 Report post Posted December 21, 2004 Try this script. I hope it will help you... :wink: Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 21, 2004 that looks pretty nifty, thanks for the post, i will check it out later on Share this post Link to post Share on other sites