3

I would like to use Google Sites to create a web site, where users can upload files. These uploaded files are stored at Google Drive, and data about the file is stored in a Google spreadsheet.

Are there any open-source applications or tutorials or libraries which can help make this possible? If not, can anybody explain how to do this?

1
  • Try Google Apps Script for that. See also Chrome Web Store for GAS apps. Commented May 9, 2013 at 13:20

2 Answers 2

1

Maybe JotForm is a solution -> http://www.jotform.com/blog/62-Send-Your-Form-Uploads-to-Google-Drive

1
  • 1
    Hi, perhaps you can put a snippet of the answer here so that this answer can stay valid when the link becomes dead? Thanks! Commented May 15, 2013 at 0:43
1

Try this code in a web app script. This code generate a Submit button and then ask for a file that the user can upload directly to a preconfigured folder of Google Drive.

var app = UiApp.createApplication(); function doGet() { var formContent = app.createVerticalPanel(); formContent.add(app.createFileUpload().setName("DSRfile")); formContent.add(app.createSubmitButton("Start Upload")); var form = app.createFormPanel(); form.add(formContent); app.add(form); return app; } function doPost(e){ var DSRload = e.parameter.DSRfile; var folders = DriveApp.getFolders(); while(folders.hasNext()){ var folder = folders.next(); if(folder.getName() === 'Expedientes'){ var Doc = DriveApp.createFile(DSRload).getId(); var file = DriveApp.getFileById(Doc); folder.addFile(file); break; } } // Display a confirmation Message var label = app.createLabel("File Upload Successful"); var clickHandler = app.createServerHandler('close'); app.add(label).add(app.createButton('close this window', clickHandler)); Logger.log('Va a cerrar 1'); // return app ?;OJO con esta linea activa, muestra error } function close(){ //OJO No entra a esta función Logger.log('Va a cerrar 2'); //return UiApp.getActiveApplication().close(); return app.close(); } 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.