Skip to content

Commit

Permalink
Handle zero length media files; address cwrc/leaf-isle-bagger#26
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferya committed Jan 16, 2025
1 parent e540c7a commit 3d833fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugin/AddMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ public function execute(Bag $bag, $bag_temp_dir, $nid, $node_json, $token = NULL
'verify' => $this->settings['verify_ca']
]);
$file_body = $file_response->getBody();
while (!$file_body->eof()) {
do {
file_put_contents($temp_file_path, $file_body->read(2048), FILE_APPEND);
}
} while (!$file_body->eof());
$bag->addFile($temp_file_path, $this->settings['media_file_directories'] . basename($temp_file_path));
}
}
Expand Down

0 comments on commit 3d833fb

Please sign in to comment.