ajaxfileupload problemajaxFileUpload is not a function

Uahmed picture Uahmed · Apr 4, 2013 · Viewed 8.7k times · Source

I am using ajaxfileupload to upload file , whenever i upload the file it gives me this error . I tried alot to fix it but no luck .

 TypeError: $.ajaxFileUpload is not a function  
 success: function (data, status)

Here is code my code .

            $id =$("#id").val();
    $.ajaxFileUpload
    (
        {
            type: "POST",
            url: "main_page/save_image_data",
            secureuri:false,
            fileElementId:'userfile'+id,
            dataType: 'json',
            data: { "image_id":id},
            success: function (data, status)
            {
                if(typeof(data.error) != 'undefined')
                {
                    if(data.error != '')
                    {
                        alert(data.error);
                    }else
                    {
                        alert(data.msg);
                    }
                }
            },
            /*error: function (data, status, e)
            {
                alert(e);
            }*/
        }
    )

    return false;

Answer

Vassilis Barzokas picture Vassilis Barzokas · Apr 4, 2013

There is no command $.ajaxFileUpload in the core of jQuery.

So you are probably trying to use an external library and you have not included it in your <head> .