#3599·cloudreve

Support Uploading Files with Unknown Total Size via API

Author: z8hhCreated Sep 22, 2026Updated Sep 22, 2026
Labelsenhancement

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed. / 请使用英语提交,否则会被关闭。
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Problem Description In some upload scenarios, the final file size is not known before the upload starts, for example:

  • Real-time archive generation
  • Database backups
  • Remote file transfers
  • Streaming compression or encryption
  • Uploading directly from an HTTP data stream If the API requires the total file size in advance, the client must first generate or download the entire file, determine its size, and only then start uploading. This prevents true streaming uploads. Example For example, when uploading a dynamically generated backup using multipart upload: Create upload task → Final file size is unknown

Read 64 MB → Upload Part 1

Read another 64 MB → Upload Part 2

Continue uploading... → Until the input stream reaches EOF

Upload the final part → Calculate the final file size from the actual uploaded parts → Complete the upload In other words: The total file size may be unknown when the multipart upload is initialized, while the size of each uploaded part is still known.

Suggested Solution Make the total file size optional in the upload API. When the client knows the file size: { "name": "example.bin", "size": 1073741824 } When the client does not know the final size: { "name": "backup.tar" } The server could allow the upload task to be created and track the actual uploaded size during the upload process. The final file size can then be recorded when the upload is completed. User quota and maximum file size limits can still be checked continuously during the upload. If the uploaded data exceeds the allowed limit, the server can reject further parts and return the appropriate error. Expected Behavior Keep the existing known-size upload behavior for compatibility, while also supporting uploads where the final file size is unknown in advance. This would enable true streaming uploads, real-time backups, and direct remote transfers.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.