0

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.