LPology / Simple-Ajax-Uploader

Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
995 stars 267 forks source link

How can I read custom data on a server? #87

Closed simar88 closed 9 years ago

simar88 commented 9 years ago

I would like to know the correct way to read data passed through the field data. Assuming that i set it to: data:{"test":"1"} I think to read it in this way on php server: var test = $_POST["test"]; but nothing is inside it. Where i'm doing wrong? Thanks in advance.

LPology commented 9 years ago

Try this:

var test = $_REQUEST["test"];

venuslikestolearn commented 9 years ago

thanks for the tip. But how one can transfer the dynamic data to the server. How can I send an value chosen from the dropdown list along with the file:

data: {"test": $("#testValue").val()}

PS: Assume that I have got an hidden input element whose value has already been set to the data from the dropdown list.