My downloaded file are all just 15kb?


When the download has happened and the file is now on the servers public folder ready to download the following code is activated:

                                filename = video.details.fileName;
                                let url = video.details.fileLocation;
                                let filename = url.substring(url.lastIndexOf("/") + 1).split("?")[0];
                                let xhr = new XMLHttpRequest();
                                xhr.responseType = 'blob';
                                xhr.onload = function() {
                                    var a = document.createElement('a');
                                    a.href = window.URL.createObjectURL(xhr.response); // xhr.response is a blob
                           = filename; // Set the file name.
                           = 'none';
                      'GET', url);

The file does download but it is only 15kb and will not play. The files in the public folder are the correct size and will play. Please help if you can!

I also tried:

                                var downloadLink = document.createElement('a'); 
                                downloadLink.href = url; 
                       = filename;