php - HTML Form With Enctype Breaks $_POST Data -
a bit of perplexing problem right now. i'm trying set form upload video.
here's form:
<form role="form" action="upload.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="upload" value="1"> <div class="row"> <div class="col-xs-6"> <span class="btn btn-lg btn-primary btn-block btn-file"> browse... <input type="file" name="file"> </span> </div><!-- col-xs-6 --> <div class="col-xs-6"> <h4 class="feedback-field text-centered">no file selected.</h4> </div><!-- col-xs-6 --> </div><!-- row --> <div class="row"> <h4 class="error-field text-centered"></h4> </div><!-- row --> <div class="row"> <div class="col-xs-4"></div> <div class="col-xs-4"> <input type="submit" name="submit" class="btn btn-primary btn-lg btn-block upload-btn disabled" value="upload"> </div> <div class="col-xs-4"></div> </div> </form>
and here's relevant php on upload.php:
if(isset($_post['upload'])){ // things file here } else { echo "no file found."; }
unfortunately, seems form not passing files next page.
as can see, form has 'enctype' value, necessary when uploading video. however, when form has value, breaks, , page 'upload.php' won't receive of $_post data (ie, show 'no file found.' message. without enctype, of course, $_files empty.
here's thing: i've tried changing this:
if(isset($_post['upload'])){
to this:
if(isset($_files['file'])){
in scenario receive 'no file found.' message. seems regardless of whether form has 'enctype' property, refuses pass files 'upload.php'.
can me out here? i'm more or less lost. google hasn't provided me answers.
edit: somehow, question downvoted within seconds of being posted - quicker might have taken answer it. may want these fraudulent downvotes.
check php.ini settings for:
file_uploads on on
max_file_uploads 20 20
post_max_size 8m 8m
upload_max_filesize 2m 2m
max_execution_time 18000 300
max_file_uploads 20 20
max_input_time 300 300
memory_limit 256m 1024m
Comments
Post a Comment