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 28b32f9..00d69a2 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java +++ b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java @@ -111,18 +111,22 @@ public class TeambitionClientService { LOGGER.info("文件预处理成功,开始上传。文件名:{},上传URL数量:{}", path, uploadUrl.size()); byte[] buffer = new byte[chunkSize]; - for (String oneUploadUrl : uploadUrl) { + for (int i = 0; i < uploadUrl.size(); i++) { + String oneUploadUrl = uploadUrl.get(i); try { int read = IOUtils.read(inputStream, buffer, 0, buffer.length); if (read == -1) { return; } client.upload(oneUploadUrl, buffer, 0, read); + LOGGER.info("文件正在上传上传。文件名:{},当前进度:{}/{}", path, (i+1), uploadUrl.size()); + } catch (IOException e) { throw new RuntimeException(e); } } + UploadFinalRequest uploadFinalRequest = new UploadFinalRequest(); uploadFinalRequest.setCcpFileId(uploadPreResult.getCcpFileId()); uploadFinalRequest.setDriveId(client.getDriveId()); 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 bd56378..047bb3f 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java +++ b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java @@ -84,6 +84,12 @@ 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;