I want to show a preview of a file (located on Google Drive) selected from a list or tree.
If I try to display an image file the image doesn't show up (allthough it is the right fileId)
function doGet()
{
var app = UiApp.createApplication().setTitle("Image");
var urlDrive = 'https://drive.google.com/file/d/0BxjtiwHnjnkrUVFKaWVaM3BNZjg';
var urlWeb = 'http://cdn.ndtv.com/tech/images/gadgets/google_webfonts_ap.jpg';
// var url = urlWeb; // works
var url = urlDrive; // Doe NOT work
var image = app.createImage(url).setHeight(200);
var panel = app.createVerticalPanel();
panel.add(image);
app.add(panel)
return app;
}
The example shows that changing the url to a file not present on Google Drive it works.
In general I would like to know if it is possible to preview a file (including msWord, msExcel and pdf) in a panel using GAS. A small example will be appreciated much of course.