Closed newtonianb closed 10 years ago
assuming the response is in a valid JSON format
{
"files": [{name:8001020224.png, size:34093, type:image/jpeg,…}],
"0": {name:8001020224.png, size:34093, type:image/jpeg,…},
"deleteType": "DELETE",
"deleteUrl": "?file=8001020224.png",
"name": "8001020224.png",
"size": 34093,
"type": "image/jpeg",
"url": "http://localhost/1387896081/8001020224.png"
}
then the downloadFieldName
configuration would be name
.
Thanks Rovak, sorry It wasn't clear from the console copy paste I did. It's returning an array so 'name' is from index 0 of this array. It's a library I'm using so now I have to either change this library or the server library.
I'm seeing it's doing this filename = data[settings.downloadFieldName];
I've just submitted a patch which can be used to manually replace the filename, see #21
onUploadedFile: function(data) {
this.replacePendingFilename(data.files[0].name);
}
I haven't tested it yet, and i'm not sure if this
refers to the proper scope, but would this fix the issue?
@newtonianb, could you update this issue if this fixed the issue or any thoughts on the suggested solution?
Thank You!
When I upload a file the server I'm dealing with returns a json in the format, how can I tell it where the URL from this response is? It looks downloadFileName looks to be the one but how exactly?