When I click on the button, the file is downloaded to the server in response, I get

{files: [{name: "screenshot (1).png", size: 1004591, type: "image/png",…}]} files:[{name: "screenshot (1).png", size: 1004591, type: "image/png",…}] 0:{name: "screenshot (1).png", size: 1004591, type: "image/png",…} deleteType:"DELETE" deleteUrl:"http://someurldelete.png" name:"screenshot (1).png" size:1004591 thumbnailUrl:"someurl.png" type:"image/png" url:"someurl.png" 

The question is how do I get the thumbnailUrl: "someurl.png" and overwrite, and then only send to the user.

  • You can read it, and write down your value there - then it will go to the user by itself - vp_arth

1 answer 1

if you get such a string, then you missed the bracket somewhere (you can check http://jsonlint.com/ here). In case you accidentally made a mistake, make

JSON.parse (your string)

and it will be possible to get and overwrite the property by reference, for example

 var recievedObj = JSON.parse(string); recievedObj.thumbnailUrl = 'changed';