Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.zip file instant interrupt #39

Open
MichalNemec opened this issue Jun 8, 2019 · 0 comments
Open

.zip file instant interrupt #39

MichalNemec opened this issue Jun 8, 2019 · 0 comments

Comments

@MichalNemec
Copy link

MichalNemec commented Jun 8, 2019

Hello,

in custom function i have

DownloadManager.download({
            url: xxx,
            path: DOWNLOAD_DIR
        }, function (error, info) {
            if (error) {
                console.log(error);
                return;
            }

            console.log("DONE: " + info.url);
        });

but for some reason .zip file is instantly interrupted. From chrome i can download it normally.

Start downloading Patch.zip
Patch.zip does not exist, download it now
Error: The download of Patch.zip was interrupted
    at DownloadItem.<anonymous> (D:\app\node_modules\electron-download-manager\index.js:63:46)
    at DownloadItem.emit (events.js:194:13)

on webhost i have this

if (file_exists($file)) {
            header('Content-Description: File Transfer');
            //header('Content-Type: application/octet-stream');
            header("Content-type: application/zip");
            header('Content-Disposition: attachment; filename="' . $file . '"');
            header('Content-Transfer-Encoding: binary');
            header('Connection: Keep-Alive');
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
            header('Content-Length: ' . sprintf("%u", filesize($file)));
            $fh = fopen($file, "rb");
            while (!feof($fh)) {
                echo fgets($fh);
                flush();
            }
            fclose($fh);
            exit;
        } else {
            header("HTTP/1.0 404 Not Found");
            exit('File not found!');
        }
@MichalNemec MichalNemec changed the title .zip file popup .zip file instant interrupt Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant