Forum Moderators: open
responseText = {"success":true,"uuid":"blah-blah-blah",","whatever":"example"} var xhr;
if (window.XMLHttpRequest)
xhr = new XMLHttpRequest();
else if (window.ActiveXObject)
xhr = new ActiveXObject("Msxml2.XMLHTTP");
// something something something
var json = JSON.parse(xhr.responseText); $('#fine-uploader-gallery').fineUploader({
template: 'qq-simple-thumbnails-template',
request: {
endpoint: 'endpoint.php'
},
// blah blah blah
})
.on('complete', function(event, uuid, uploadName, responseJSON) {
alert(uuid + ', ' + uploadName + ', ' + responseJSON['uuid']);
});
*name: String - Name of the file.
*uuid: String - UUID of the file.
size: Number - Size of the file, in bytes.
deleteFileEndpoint: String - Endpoint for the associated delete file request. If omitted, the deleteFile.endpoint is used.
deleteFileParams: Object - Parameters to send along with the associated delete file request. If omitted, deleteFile.params is used.
thumbnailUrl: String - URL of an image to display next to the file.
*s3Key: String - Key of the file in your S3 bucket. Only required if using Fine Uploader S3.
*s3Bucket: String - Name of the bucket where the file is stored in S3. Only required if using Fine Uploader S3 and if the bucket cannot be determined by examining the endpoint URL (such as when routing through a CDN).
*blobName: String - Name of the file in your Azure Blob Storage container. Only required if using Fine Uploader Azure.
function jsonObj(id, image) {
this.name = image;
this.uuid = id;
this.thumbnailUrl = '/fineuploader/files/' + id + '/' + image;
}
var imgObj = new Array();
imgObj[0] = new jsonObj('blah-blah-blah', 'example.jpg');
imgObj[1] = new jsonObj('blah2-blah2-blah2', 'example_2.jpg');
JSON.stringify(imgObj);
// print results to the console for testing
console.log(imgObj); {"name":"example.jpg", "uuid":"blah-blah-blah", "thumbnailUrl":"/fineuploader/fles/blah-blah-blah/example.jpg"},
{"name":"example_2.jpg", "uuid":"blah2-blah2-blah2", "thumbnailUrl":"/fineuploader/fles/blah2-blah2-blah2/example_2.jpg"}