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

问题描述 投票:0回答:1

我试图做一个表单的服务器端验证与文件附件。我想不出正确的语法得到该文件的大小。我努力了:

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.


It's just an html form that is submitted to a *.gs page. <input type="file" id="myFile"> Then, on the *.gs page - doGet() - then pulls in the form.

有任何想法吗?非常感谢!!!

html google-apps-script server-side html-form
1个回答
0
投票
form.myFile.length; // that worked!
© www.soinside.com 2019 - 2024. All rights reserved.