获取文件大小 - 服务器端验证



我正在尝试对带有文件附件的表单进行服务器端验证。 我无法找出获取文件大小的正确语法。 我试过:

form.myFile.files[0].size;
form.myFile.file.size;
form.myFile.getSize();
form.myFile.getName(); // this works and does return the name of the file.


它只是一个提交到 *.gs 页面的 html 表单。 <input type="file" id="myFile"> 然后,在 *.gs 页面上 - doGet(( - 然后拉入表单。

有什么想法吗? 非常感谢!!

form.myFile.length; // that worked!

最新更新