|||
1.通过 <input type="file" multiple name="file1" accept="text/plain"/> 可以非常容易的限制上传文件类型为txt文本文件
2.想对上传的文件按照系统时间命名,用以下代码获得当前时间:
SimpleDateFormat currentTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(currentTime.format(new Date()));
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-6-3 20:33
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社