burge124 Posted March 4, 2008 Share Posted March 4, 2008 test Quote Link to comment Share on other sites More sharing options...
burge124 Posted March 4, 2008 Author Share Posted March 4, 2008 hi, ive got a file browser where the user selects which file they want to upload to the database, although i cant get selection the user chooses to be passed on so that the page requested is used! any help would be great thanks! <form enctype="multipart/form-data" action="" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a question to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> <label> <input name="reset1" type="reset" id="reset1" value="Reset" /> </label> </form> <p> </p> <? $SelectedFile = $_POST['uploadedfile']; // echo '$SelectedFile' // echo the selected files name ?> Quote Link to comment Share on other sites More sharing options...
bpops Posted March 4, 2008 Share Posted March 4, 2008 You can't use $_POST for uploaded files. You must use $_FILES. See http://us2.php.net/features.file-upload Also, you are using the max_file_size in your form, which is fine, but keep in mind this is a client-side check, and you should also verify the size in PHP following upload. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 4, 2008 Share Posted March 4, 2008 The MAX_FILE_SIZE in the form is not checked by the browser. No past or present browser has ever checked it. Php does check it if it is present and sets an error if the uploaded file is greater than the value - UPLOAD_ERR_FORM_SIZE Value: 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.