From fd12ea1e47754279dbce23497806358257980d35 Mon Sep 17 00:00:00 2001 From: "zhouxin5253@163.com" <9a@2gvp!hs3> Date: Mon, 18 Jan 2021 22:23:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BA=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=BF=9B=E5=BA=A6=EF=BC=8C=E4=BC=98=E5=8C=96=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/TeambitionClientService.java | 2 +- .../store/TeambitionFileSystemStore.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java index 00d69a2..fb155a9 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java +++ b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java @@ -119,7 +119,7 @@ public class TeambitionClientService { return; } client.upload(oneUploadUrl, buffer, 0, read); - LOGGER.info("文件正在上传上传。文件名:{},当前进度:{}/{}", path, (i+1), uploadUrl.size()); + LOGGER.info("文件正在上传。文件名:{},当前进度:{}/{}", path, (i+1), uploadUrl.size()); } catch (IOException e) { throw new RuntimeException(e); diff --git a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java index 047bb3f..930e408 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java +++ b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java @@ -84,16 +84,18 @@ public class TeambitionFileSystemStore implements IWebdavStore { LOGGER.info("setResourceContent {}", resourceUri); ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest request = requestAttributes.getRequest(); - String expect = request.getHeader("Expect"); - - // 支持大文件上传 - if ("100-continue".equalsIgnoreCase(expect)) { - return 0; - } int contentLength = request.getContentLength(); if (contentLength < 0) { contentLength = 0; } + if (contentLength == 0) { + String expect = request.getHeader("Expect"); + + // 支持大文件上传 + if ("100-continue".equalsIgnoreCase(expect)) { + return 0; + } + } teambitionClientService.uploadPre(resourceUri, contentLength, content); return contentLength; }