Hello guys, I want to upload file to sharepoint across an API I have created, already achieve that but it's too slow.
I use the following build-in file upload component, and when the file is parsed, It execute the sharepoint upload REST APi, where I pass the file cotent as base64string
I tested this on my end by logging both the onChange and onParse events and it took less than a second to parse a ~20MB file. The computer I use is fairly powerful, though, and the parsing operation does run client-side. It's possible that the slowdown you're seeing is due to hardware limitations.
Can you let me know if you're still experiencing this issue and, if so, if you notice any difference when accessing the app on a different machine?
Yes, the problem was solved, What I did was.. insted of upload and parsing 1 file at the time, I tried to proccess multiple files at same time, and magically it spend less time... I don't know why but it works for me
I have a js, and for each file selected by user, call the uploadFileSharepoint EndPoint.
And the uploadButton setting, just changed to allow multiple file selection:
Ah I didn't catch the fact that you were needing to process multiple files. It makes some sense that your overall workload would be faster doing it this way, but I don't know why individual files would be processed more quickly.
Looking back at your original post, I also want to mention that it shouldn't be necessary to parse the files unless you are actively utilizing the contained data in your app. That particular option shouldn't have any affect on the base64Data.
If I don't parse the file, it would be corrupted. I upload the file to Sharepoint by APi, and without parsing, I cannot open the fiel, it shows like the file content is wrong.
I think it is beacause the file content(base64string) isn't completely loaded in the component and I have pass the content to the API before the content is completely loaded