Ha4869
Ha4869

Reputation: 9

Multiple File Upload PHP from Div tag

Here Is the code :

<div action="form_upload.html" class="drop zone" name="file upload"></div>

I got the code from the bootstrap template. there is no Input file tag. how can I upload file from that div to mysql using PHP. I tried upload using common way, but I can't get the filename.

Upvotes: 0

Views: 113

Answers (1)

Zain Farooq
Zain Farooq

Reputation: 2964

I don't know the whole scenario but in my understanding, you want a div behaving like a file input tag. So you can do this like this

<input type="file" id="fileupload" style="display:none"/> <!--Set display none -->
<div id="OpenImgUpload">File Upload</div>

And on the div's click event write the jQuery code like :

$('#OpenImgUpload').click(function(){ $('#fileupload').trigger('click'); });

Rest you can apply further jquery code for submitting the form values

Upvotes: 1

Related Questions