0

I'm trying to upload big files as multipart, so I convert the blob to base64string (by dividing the file to 5 MB chunks), however when I want to send it to the API the size is much bigger than the real size, when I copy the base64string to a text file and save it, the size is about 7 MB but when I try to post it, the size is more than 13 MB!!

enter image description here

Here is the code:

private UploadFileChunk(fileName: string, base64Chunk: string, partCount: number,uploadId:string): Promise<any> {
    const dataToSend = {
      fileName,
      partNumber:partCount,
      fileChunk: base64Chunk,
      uploadId
    };

    return this.props.service.post(`apiURL/api/uploadchunks`, JSON.stringify(dataToSend));
  }
fredrik
  • 6,483
  • 3
  • 35
  • 45
Ramin Ahmadi
  • 65
  • 1
  • 8

0 Answers0