I’m using php/xhr to upload files (uppy/upload.php at main · transloadit/uppy · GitHub)
The “url” and “message” should be returned to the client here:
$data = ['url' => $target_file, 'message' => 'The file ' . basename($_FILES['files']['name'][0]) . ' has been uploaded.'];
http_response_code(201);
echo json_encode($data);
I’ve added both a complete and upload-success event but I don’t seem to find the ‘url’ and ‘message’ strings in the returning variables result / file and response.
uppy.on('complete', (result) => {
console.log(result);
})
uppy.on('upload-success', (file, response) => {
console.log(file);
console.log(response);
});
How to retrieve the data that is output with echo json_encode($data); ?