0

How i can properly use of downloadReady:function(fileContents, blob){} in order to upload an xlsx file to server side?

what are the preparations should be made at client side before send file? ex. conversion to Uri maybe? and what steps needed to decode file to server side? from Uri to xlsx file.

fileContents returns ArrayBuffer() {} as result which consist of [[Int8Array]] and [[Uint8Array]]. and blob returns data type.

The goal is to take the file from client and upload it to server (node.js) then save it locally with fs.write().

if you have any snippet code will be helpful just to realize the steps!

Thanks in advance!

UPDATE What i've used without success! CLIENT SIDE

downloadReady:function(fileContents, blob){

var xlsxObject = new Object;
xlsxObject.data = fileContents;
sendObjectToServer(xlsxObject);

return blob;
},

SERVER SIDE

fs.writeFile("test.xlsx", xlsxObject,{encoding:'base64'}, (err) => {
             if (err) console.log(err);
             console.log("Successfully Written to File xlsx.");
});

the file is written but empty with undefined value

[SOLVED]

I finally found a solution, if you are interested check this post

George Gotsidis
  • 426
  • 4
  • 15

0 Answers0