Search code examples
jqueryuploadify

Uploadify open browse dialog when click on a custom picture


I am using Uploadify to upload pictures.

I am having a picture, and I want to Uploadify open the browse files dialog after clicking on the image, how can I achieve this ?

Here is my code

$("#btnAddImg").click(function() {
    Uploading(); 
});

function Uploading() {

    var a = $("input#Id").val();

    alert("uploading" + a);

    $("#fileuploader").uploadify({
        'uploader': '/Scripts/uploadify/uploadify.swf',
        'cancelImg': '/Content/Images/icones/cancel.png',
        //'buttonText': 'Select Image',
        //'buttonImg': '/Content/Images/icones/picture-add-icon.png',
        'script': 'Home/Upload',
        'folder': a,
        'fileDesc': 'Image Files',
        'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
        'multi': true,
        'auto': true
    });
}

Ps: I don' t want to use the 'buttonImg': integrate property, as I want uploadify to load only after clicking my custom image ( as behind the scene I want to get the dynamic folder path and pass to uploadify)


Solution

  • Better solution -> http://valums.com/ajax-upload/

    See Examples -> http://valums.com/files/2009/ajax-upload/demo-jquery.htm