Browse Source

REPORT-29472 不带后缀的文件名没有被修改

master
richie 5 years ago
parent
commit
416ba320f5
  1. 3
      plugin.xml
  2. 13
      src/main/java/com/fr/plugin/file/submit/oss/fun/OssUpload.java

3
plugin.xml

@ -2,7 +2,7 @@
<id>com.fr.plugin.file.submit.oss</id> <id>com.fr.plugin.file.submit.oss</id>
<name><![CDATA[OSS文件上传下载]]></name> <name><![CDATA[OSS文件上传下载]]></name>
<active>yes</active> <active>yes</active>
<version>4.2</version> <version>4.7</version>
<env-version>10.0</env-version> <env-version>10.0</env-version>
<jartime>2019-06-13</jartime> <jartime>2019-06-13</jartime>
<vendor>author</vendor> <vendor>author</vendor>
@ -11,6 +11,7 @@
<item type="plugin" key="com.fr.plugin.oss.universal"/> <item type="plugin" key="com.fr.plugin.oss.universal"/>
</dependence> </dependence>
<change-notes><![CDATA[ <change-notes><![CDATA[
[2020-04-23]新文件名即使没有后缀,上传后也用新文件名。<br/>
[2019-06-21]适配最新的版本,修改下载乱码问题。<br/> [2019-06-21]适配最新的版本,修改下载乱码问题。<br/>
[2019-03-11]适配最新的10.0。<br/> [2019-03-11]适配最新的10.0。<br/>
[2018-12-29]移除内置的OSS配置,依赖公共的OSS配置。<br/> [2018-12-29]移除内置的OSS配置,依赖公共的OSS配置。<br/>

13
src/main/java/com/fr/plugin/file/submit/oss/fun/OssUpload.java

@ -65,12 +65,13 @@ public class OssUpload {
fileName = "unnamed.png"; fileName = "unnamed.png";
} }
if (StringUtils.isNotEmpty(myFileName)) { if (StringUtils.isNotEmpty(myFileName)) {
int index = myFileName.lastIndexOf("."); realFileName = myFileName;
if (index == -1) { // int index = myFileName.lastIndexOf(".");
realFileName = fileName; // if (index == -1) {
} else { // realFileName = fileName;
realFileName = myFileName; // } else {
} // realFileName = myFileName;
// }
} else { } else {
realFileName = fileName; realFileName = fileName;
} }

Loading…
Cancel
Save