Callback does not contain any relevant information. What should I do?

We are often asked why following construct doesn't return information about file:

dialog.done(function(result) 
  {  // Dialog closed and file or file group chosen. });

The result in this context is a file promise object, or fileGroup promise object, if it's a multiselect widget. It implements jQuery.promise interface. This is done because objects might not be available immediately, but you still would want to use it in your code (i.e to subscribe additional callbacks)

Here is an example of code that extracts actual file information from the file.

	uploadcare.openDialog(null, { publicKey: 'demopublickey',

	                                               imagesOnly: true,
	                                               crop: "1:1",
	                                               doNotStore: true,
	                                               imageShrink: "600x600"
	}).done(function(file) {
	                                     // this is a promise 
	                   if (file)   { // promise was completed
	                                 file.done(function(fileInfo) {  
	                   // this is an object with all the relevant file information   
	                                 console.log(fileInfo.uuid);   
	                                                              });   
	                               }   
	                        });

In this example file UUID will be outputted in console. If you need any additional information about the file - please look through our docs here  https://uploadcare.com/documentation/javascript_api/#file.