[英]How to check whether the uploaded file is XLS file or not?
I have a file uploader module. 我有一个文件上传器模块。 The UI is created using simple HTML and Javascript.
用户界面是使用简单的HTML和Javascript创建的。 Server side I am using Java code.
服务器端我正在使用Java代码。 I want to check the type of the uploaded file.
我想检查上传文件的类型。
Files don't really have types. 文件实际上没有类型。 The best you can do would be to attempt to load the file as an XLS.
最好的办法是尝试将文件加载为XLS。
You can also look at the uploaded file name or the content type, but neither of these is definitive; 您也可以查看上载的文件名或内容类型,但这两个都不是确定的。 ie they might say that the file is an XLS when it is something completely different.
也就是说,当文件完全不同时,他们可能会说该文件是XLS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.