Skip to content Skip to sidebar Skip to footer

Jquery Custom File Input Plugin

This jquery plugin allows you to turn any element into a file input element. http://plugins.jquery.com/project/custom-file But to actually upload the file, the only documentation

Solution 1:

I think you need to create an html form and append the input to the form, and if you need to submit, you can do it via a submit button or via $.submit

    # from http://www.daimi.au.dk/~u061768/file-input.html
    <scripttype="text/javascript">
$(function() {
    $('button').button().add('#foo, a').file().choose(function(e, input) {
        $(input).appendTo('#TheForm').
                         attr('name', 'a-name').
                         attr('id', 'an-id');
    });


});
    </script>
    ...
    <formmethod="post"enctype="multipart/form-data"id="TheForm"action="/path/in/your/server/"><inputtype="submit"value="send"></form>

Anyway this is not the best plugin for submiting the files via ajax.

Solution 2:

The uploading itself is not of the scope of this plugin. You should see this with your server side technology.

Post a Comment for "Jquery Custom File Input Plugin"