Я настоящий новичок. Я не могу загружать на свой диск файлы размером более 15 МБ. Как мне найти проблему? все нормально под 15 мб, но помимо этого у меня есть это сообщение:
TypeError: невозможно вызвать метод getUrl из undefined.at uploadFiles (server: 31)
Вот что я сделал до сих пор:
Server.gs
function doGet(e) {
return HtmlService.createHtmlOutputFromFile('form.html');
}
function uploadFiles(form) {
try {
var dropbox = "_Upload FreeMaster"; // Input the name of the folder to be used for holding the uploaded files
var folder, folders = DriveApp.getFoldersByName(dropbox);
if (folders.hasNext()) {
folder = folders.next();
} else {
folder = DriveApp.createFolder(dropbox); // Otherwise by default a 'dropbox' folder will be created
}
var blob = form.myFile;
var file = folder.createFile(blob);
file.setDescription("Uploaded by " + form.myName);
return "File uploaded successfully. Thank you " + form.myName + file.getUrl();
}
catch (error) {
return error.toString();
}
finally {MailApp.sendEmail ("OOOOO@gmail.com", // to field for the email. Can input multiple, ie: "1@email.com, 2@email.com",
"000000@gmail.com", // from field
"Master upload detected", // email subject
"You have a new file upload to review by" + file.getUrl("here"+ form.myName) ); // email body+ form.myName
MailApp.sendEmail (form.Email, // to field for the email. Can input multiple, ie: "1@email.com, 2@email.com",
"00000@gmail.com", // from field
"Free Master upload detected", // email subject
"Hi, Your Upload has been received. We'll get back to you ASAP. Best " ); // email body
}
}
Форма. html