Jquery ajax uploader with query string

I used the following plugin for upload progress bar

http://blog.stevensanderson.com/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/

jQuery(document).ready( function () { 
         $(".flupload").makeAsyncUploader({
        upload_url: "upload_logo_file.php?pid="+($(this).attr("id")), 
        flash_url: 'swfupload.swf',
        button_image_url: 'blankButton.png'
    });

    });

In my html form i used the floowing

<input type="file" id="1550" name="1550" class="flupload" />
<input type="file" id="1552" name="1552" class="flupload" />

The upload progress bar is working fine here. But my problem is: i want to pass the id (1550 or 1552) with the 'Upload_url' parameter.

For this used the following

upload_url: "upload_logo_file.php?pid="+($(this).attr("id")), 

But the Id is not retrieved here while using ($(this).attr("id"))

How to get the current id here.

Please help.

Answers


Your ids are not valid html ids. Use a custom data attribute instead, like so:

<input type="file" data-id="1550" name="1550" class="flupload" />

and

upload_url: "upload_logo_file.php?pid="+$(this).data("id"),

Need Your Help

How to Run a script at the start of Container in Cloud Containers Engine with Kubernetes

docker kubernetes dockerfile google-kubernetes-engine

I am trying to run a shell script at the start of a docker container running on Google Cloud Containers using Kubernetes. The structure of my app directory is something like this. I'd like to run