Question

I am using bootstrap file upload. My html code is give below

 <div class="form-group">
    <label>Video Name:</label>
   <input class="form-control" placeholder="Video Name" id="vname" name="vname">
       </div>
    <span class="btn btn-success fileinput-button">
                        <i class="glyphicon glyphicon-plus"></i>
                        <span>Add files...</span>
                        <input type="file" name="files[]" id="fileupload1" multiple>
                    </span>
                    <button type="submit" class="btn btn-primary start">
                        <i class="glyphicon glyphicon-upload"></i>
                        <span>Start upload</span>
                    </button>

But when i look in Server side code in Request form there is vname value but files[] is empty. Please help how to get file data in server and save it on hard disk. Thanks

Was it helpful?

Solution

have you set the enctype attribute on the form to multipart/form-data?

<form enctype="multipart/form-data">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top