mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Use streams
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
e5a205fec1
commit
bf79b97718
1 changed files with 3 additions and 3 deletions
|
|
@ -78,7 +78,7 @@ class AccountMigrator implements IMigrator {
|
|||
$exportFilename = AccountMigrator::EXPORT_AVATAR_BASENAME . '.' . $avatarFile->getExtension();
|
||||
|
||||
$output->writeln('Exporting avatar to ' . $exportFilename . '…');
|
||||
if ($exportDestination->addFileContents($exportFilename, $avatarFile->getContent()) === false) {
|
||||
if ($exportDestination->addFileAsStream($exportFilename, $avatarFile->read()) === false) {
|
||||
throw new AccountMigratorException('Could not export avatar');
|
||||
}
|
||||
}
|
||||
|
|
@ -135,9 +135,9 @@ class AccountMigrator implements IMigrator {
|
|||
$importFilename = reset($avatarFiles);
|
||||
|
||||
$output->writeln('Importing avatar from ' . $importFilename . '…');
|
||||
$data = $importSource->getFileContents($importFilename);
|
||||
$stream = $importSource->getFileAsStream($importFilename);
|
||||
$image = new \OC_Image();
|
||||
$image->loadFromData($data);
|
||||
$image->loadFromFileHandle($stream);
|
||||
|
||||
try {
|
||||
$avatar = $this->avatarManager->getAvatar($user->getUID());
|
||||
|
|
|
|||
Loading…
Reference in a new issue