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; }