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

Add files from remote #87

Open
fakhamatia opened this issue Mar 6, 2022 · 0 comments
Open

Add files from remote #87

fakhamatia opened this issue Mar 6, 2022 · 0 comments

Comments

@fakhamatia
Copy link

Description
PHP has a function called copy
copy get two parameters, source and destination.
We can use a remote file for source not a local file, like:
copy('http://someserver.com/somefile.zip','./somefile.zip')
Please add feature to add remote files for function addFile

Example

$zipFile = new \PhpZip\ZipFile();
try {
    $zipFile
        ->addFile('http://192.168.98.242/store/0/2022/03/06/16/2022-03-06_16-33-06_131715438_7843520/2022-03-06_16-33-06_131715438_0_1_0_L1_P.jpg', './test.jpg')
        ->saveAsFile("/var/www/html/temp/temp.zip")
        ->close();
} catch (\PhpZip\Exception\ZipException $e) {
   echo "Error: " . $e->getMessage();
} finally {
    $zipFile->close();
}
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