上传文件windows去除盘符

dep_wangsr
RuoYi 5 years ago committed by Limy
parent a6f820c341
commit 2eecb9f913

@ -53,7 +53,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label"><span style="color: red; ">*</span>登录账号:</label> <label class="col-sm-4 control-label"><span style="color: red; ">*</span>登录账号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="loginName" placeholder="请输入登录账号" class="form-control required" type="text" maxlength="30" required> <input name="loginName" placeholder="请输入登录账号" class="form-control" type="text" maxlength="30" required>
</div> </div>
</div> </div>
</div> </div>

@ -113,7 +113,12 @@ public class FileUploadUtils
File desc = getAbsoluteFile(baseDir, fileName); File desc = getAbsoluteFile(baseDir, fileName);
file.transferTo(desc); file.transferTo(desc);
String pathFileName = StringUtils.substringAfterLast(baseDir, ":") + fileName; String pathFileName = baseDir + fileName;
if (StringUtils.contains(baseDir, ":"))
{
// windows 去除盘符
pathFileName = StringUtils.substringAfterLast(baseDir, ":") + fileName;
}
return pathFileName; return pathFileName;
} }

Loading…
Cancel
Save