Page MenuHomePhabricator
Paste P959

gscript.gs
ActivePublic

Authored by epriestley on Oct 22 2013, 3:20 AM.
Tags
None
Referenced Files
F73145: gscript.gs
Oct 22 2013, 3:20 AM
Subscribers
None
function showAlert() {
var app = UiApp.createApplication();
app.setTitle("Upload File");
var form = app.createFormPanel();
app.add(form);
var content = app.createVerticalPanel();
form.add(content);
content.add(app.createFileUpload().setName('thefile'));
content.add(app.createSubmitButton("Upload File"));
var ui = DocumentApp.getUi();
ui.showDialog(app);
}
function doPost(eventInfo) {
var app = UiApp.getActiveApplication();
var doc = DocsList.createFile(eventInfo.parameter.thefile);
var content = doc.getContentAsString();
// DO AJAX STUFF
// Optionally, this closes the dialog.
app.close();
return app;
}

Event Timeline

epriestley changed the title of this paste from untitled to gscript.gs.
epriestley updated the paste's language from autodetect to autodetect.
epriestley changed the visibility from "All Users" to "Public (No Login Required)".