Share via

Upload file using upload session break some content

Romain LOPES 1 Reputation point
2022-01-24T09:05:18.577+00:00

Hi everyone,

I'm trying to upload file bigger than 4MB (coming from another sharepoint tenant) using upload session.
When i'm downloading the content of the file and upload it to the other tenant the target file size changed and the QuickXorHash value too.
If i'm testing the same thing with a file smaller than 4MB, I'm able to reproduce it. (File always miss 11 bytes).
But when I'm using the put method (/content endpoing for file smaller than 4MB) the hash and file size are correct.
I tried with more than 1 file and each time I have the same result and each time it's missing 11 bytes.

Expected behavior
Item hash and size should be the same
Even in windows, the file size are differents (uploaded file is smaller than source file)

Additional context
In my case, i'm downloading a file from one tenant and upload it to another tenant.

Any idea / workarround ?

Microsoft Security | Microsoft Graph

2 answers

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,851 Reputation points Microsoft External Staff
    2022-03-10T16:43:05.937+00:00

    Hi @Romain LOPES ,

    Best practices-createuploadsession Use resumable file transfers for files larger than 10 MiB (10,485,760 bytes).
    For files smaller than 4MB, please make use of simple upload API, alternatively use upload session pass the entire content-ranges in single API call as the upload session can accept a maximum of 60MiB in API request.

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Was this answer helpful?

    0 comments No comments

  2. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2022-01-26T07:18:25.663+00:00

    Hi @Romain LOPES ,
    Since we are unable to upload files smaller than 4 mb completely. I will recommend you to use following document to upload files
    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-large-files-sample-app-for-sharepoint


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.