I'm having a Electron application internally I'm loading the Angular application. I'm downloading a byte array (i.e., ArrayBuffer) through an API call and passing those data to a method which I'm connecting through electron.remote.require('./file-service')
to create a file in a local file system.
If I'm downloading till 120 MB it supports. if I'm downloading more than this size, it hangs the window and UI too became white screen.
Sample Angular Code:
declare var electron: any;
const { createDataFile } = electron.remote.require('./file-service')
const payLoad = new FormData();
const httpOptions = {
headers: new HttpHeaders(),
reportProgress: true,
};
const req = new HttpRequest('GET', 'http://localhost:8080/getData', payLoad, {...httpOptions, responseType: 'arraybuffer'});
this.http.request<ArrayBuffer>(req).subscribe((event: HttpEvent<ArrayBuffer>) => {
switch (event.type) {
case HttpEventType.Response:
createDataFile(event.body)
break;
}
});
File System related code: file-service.js
module.exports = {
createDataFile(fileData) {
}
}
I made the method with zero statement, still its hanging and the window becomes white.
Electron window:
Kindly assist me how to fix this issue.