Last active
December 6, 2020 08:28
-
-
Save klaasvw/b580cb53cc46ebc76ab3a1e2104869df to your computer and use it in GitHub Desktop.
Download file in Drupal using Guzzle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$external_file = 'https://www.example.com/test.png' | |
$destination = 'public://file.png'; | |
$response = \Drupal::httpClient()->get($external_file, ['sink' => $destination]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment