I am looking to create a button which when clicked opens a dialog window where they select an image to upload and then once they select it and press ok within the dialog window the upload begins (upload bar optional :) )
Preferable it would be a jquery plugin that modifys the functionality of the standard html file input... as I have already written the code using one.
The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute. Tip: Always add the <label> tag for best accessibility practices!
JQuery plugin uploadify will upload with a progress bar, and includes functionality for single or multiple file uploads.
SWFUpload is able to do that. It is a Flash-based upload component that you can interact with using JavaScript.
Demo
There are other flash based solutions other than SWFupload. Have a look at uploadify.com
This is a jquery plugin.
there is some cheat to do this using jquery and ordinary html. this is what i use in my project to upload one file (limited to one) and just using one button and no plugin whatsoever although it's button needs styling.
HTML code
<form method="get" action="somephp.php">
<input type="file" id="upload" name="upload" style="width: 88px; opacity:0.0; filter:alpha(opacity=0); " onchange='uploadChange()'/>
<input type="submit" name="submit" style="margin-left: -88px"/>
</form>
jquery :
<script>
function uploadChange(){
$('input[type="submit"]').click();
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With