javascript - How to get direct link to file uploaded via form? -


i using google apps script upload file folder in google drive. possible, in apps script, direct link file had uploaded? currently, able link folder saving files.

code using upload files:

function processform(theform) {   try{     var fileblob1 = theform.resumefile;     var fileblob2 = theform.pifile;      var fldrsssn = driveapp.getfolderbyid('my folder id');     fldrsssn.createfile(fileblob1);     fldrsssn.createfile(fileblob2);     return fldrsssn.geturl();    }catch(e) {       logger.log(e);   }//end catch } 

you first need keep file object returned folder.createfile(), use retrieve file url.

function processform(theform) {   try{     var fileblob1 = theform.resumefile;     var fileblob2 = theform.pifile;      var fldrsssn = driveapp.getfolderbyid('my folder id');     var file1 = fldrsssn.createfile(fileblob1);     var file2 = fldrsssn.createfile(fileblob2);      // return urls in single object     return {        folderurl: fldrsssn.geturl(),       file1url:  file1.geturl(),       file2url:  file2.geturl()     };    }catch(e) {       logger.log(e);   }//end catch } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -