pekebyte / pekeUpload

jQuery html5 file uploader plugin
http://pekebyte.github.io/pekeUpload
Other
82 stars 73 forks source link

How are the data variables accessed server side? #6

Closed MathTV closed 9 years ago

MathTV commented 11 years ago

On the server, $_REQUEST['data']['var_name'] does not return 'my_value'

Here's the config:

        $(".file-upload-field").pekeUpload({
            url:'/ajax/upload_file',
            data:{
                'var_name':'my_value'
            }
        });
pekebyte commented 9 years ago

On the version 1.6.0 on you can access to the data through


$data = json_decode($_POST['data']);
echo $data->var_name;

Which is very uncomfortable, I did a major update today, this was my very first jQuery plugin, and when I coded this I was actually learning, so, I decided to improve it, and in the new version (2.0.0) you can do that, simply like this:


$myphpvar = $_POST['var_name'];

Thank you for using pekeUpload.