I receive a list of files from the phone, and then I need to send data to the server, but since the data I have is not one thing, they are sent all separately, how can I collect them to a heap? I send it with jQuery like this:
function listResults(entries) { dir_i = 0; file_i = 0; imageURI = entries[0].toURL(entry.name); options = new FileUploadOptions(); options.chunkedMode = false; options.fileKey = "text"; options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1); //alert(options.fileName); options.mimeType = "text/plain"; params = new Object(); entries.forEach(function (entry) { if (entry.isDirectory) { params.dir_[dir_i] = entry.name; dir_i++; } else { params.file_[file_i] = entry.name; file_i++; } }); options.params = params; $.post("http://91.228.199.95/ksiywFac63f2hs/userfotos.php", { dir:options }, function (data) { // alert("Data Loaded: " + data); }); }
entry.name - a list of file names that I get using DirectoryReader'a
result
variable contain? Or is it casting on the battle of psychics? - Zowie