how to increase sliceSize from 4mb ? my document is bigger than 4mb

フนӥăіḑ Ṁ' 20 Reputation points
2023-10-05T08:53:24.76+00:00
function sendFile() {
    Office.context.document.getFileAsync("compressed",
        { sliceSize: 100000 },
        function (result) {

            if (result.status === Office.AsyncResultStatus.Succeeded) {

                // Get the File object from the result.
                var myFile = result.value;
                var state = {
                    file: myFile,
                    counter: 0,
                    sliceCount: myFile.sliceCount
                };

                updateStatus("Getting file of " + myFile.size + " bytes");
                getSlice(state);
            } else {
                updateStatus(result.status);
            }
        });
}

for full details visit
https://learn.microsoft.com/en-us/javascript/api/office/office.document?view=word-js-1.3#office-office-document-getfileasync-member(1)

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,767 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. フนӥăіḑ Ṁ' 20 Reputation points
    2023-12-04T05:26:52.47+00:00

    this is why because I am getting only one slice and converting it to base64 when I got All Slices and convert these to base64 then All is done.

    0 comments No comments

Your answer

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