Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-18247

A few improvements for the batch upload in chunks

    XMLWordPrintable

    Details

      Description

      • Cut a real binary file into chunks in BatchUploadFixture#textChunkedUpload and BatchUploadFixture#testBatchExecuteWithChunkedUpload. This will illustrate the way of making chunks.
      • Handle a null X-File-Size header in chunked mode.
      • BatchManager#addStream could return the effective uploaded size, otherwise the uploadedSize return value based on the Content-Length header is not reliable, currently only set in multipart. In fact it should return the BatchFileEntry to avoid fetching it just after having created it in the case of chunks:
        if (UPLOAD_TYPE_CHUNKED.equals(uploadType)) {
            BatchFileEntry fileEntry = Framework.getService(BatchManager.class).getFileEntry(batchId, fileIdx);
            ...
        }
        

        For an upload by chunks maybe we want the total uploaded size (sum of the uploaded chunks)?
        And maybe use a use subclass of FileEntry like ChunkedFileEntry?

      • In BatchFileEntry#addChunk: when uploading the last chunk, check file size consistency? If not OK send a dedicated status code?
      • In BatchFileEntry#getBlob, check real file size against expected fileSize and handle error?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ataillefer Antoine Taillefer
                Reporter:
                ataillefer Antoine Taillefer
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: