优化上传文件的文件名

hdrplus
Matthew 11 months ago
parent fad7f20ed1
commit 7a2a9a1f6d

@ -1074,7 +1074,13 @@ public class AppMaster {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
Date dt = new Date(ts);
final String fileName = mCmdid + "_" + format.format(dt) + ".zip";
String fileName = "";
if (paths.size() != 1) {
fileName = mCmdid + "_" + format.format(dt) + ".zip";
} else {
File file = new File(paths.get(0));
fileName = mCmdid + "_" + format.format(dt) + "_" + file.getName() + ".zip";
}
final File file = File.createTempFile(fileName, null, new File(appDir));
if (file == null) {
return;

Loading…
Cancel
Save