1

I'm using Google Script App to upload the file on the form. Suddenly, the uploaded logic stop working.The uploaded files are corrupted and twice size as original file.

Here the code samples:

<input id="applicantPhoto" class="upload-file-field" type="file" name="applicantPhoto"> 

GS:

var folder = DriveApp.createFolder("MyUploadFolder);
var blob = form.applicantPhoto; 
var file = folder.createFile(blob);

The headers of the files are different. The broken uploaded jpg file's header: ���� JFIF �� Original jpg file: ÿØÿà JFIF ÿâ

TheMaster
  • 45,448
  • 6
  • 62
  • 85
Cinava
  • 59
  • 6
  • Have you [searched](https://stackoverflow.com/questions/tagged/google-apps-script+file-upload+google-apps-script-web-application?sort=newest) for similar problems first? See https://meta.stackoverflow.com/questions/261592/ – TheMaster Mar 31 '20 at 20:38
  • 1
    Does this answer your question? [Moving google apps script to v8 file upload stopped working from sidebar](https://stackoverflow.com/questions/60742695/moving-google-apps-script-to-v8-file-upload-stopped-working-from-sidebar) – TheMaster Mar 31 '20 at 20:38
  • Thank you, V8 caused this problem. I disabled this option and the uploads are working again. – Cinava Apr 01 '20 at 14:57

1 Answers1

2

I found a solution: https://issuetracker.google.com/issues/150675170

Make sure to use Rhino JavaScript interpreter: Run->Disable new Apps Script runtime powered by Chrome V8.

Cinava
  • 59
  • 6