Skip to content

Commit

Permalink
creocoder still using Flysystem v1
Browse files Browse the repository at this point in the history
  • Loading branch information
zmiftah committed Mar 4, 2021
1 parent 18d2e0e commit a69df6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uploader/FileUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public function upload($prefix, FileModelInterface $fileModel)
$stream = fopen($uploaded->tempName, 'r+');
$filename = "{$prefix}_{$uploaded->name}";
$fullpath = "{$this->targetDir}/{$filename}";
$result = $this->fileSystem->writeStream($fullpath, $stream); //write or update
$result = $this->fileSystem->putStream($fullpath, $stream); //write or update
fclose($stream);

if ($retval = $this->fileSystem->fileExists($fullpath)) {
if ($retval = $this->fileSystem->has($fullpath)) {
$retval = $fileModel->saveFile($uploaded, $filename, $this->targetDir, $this->type);
} else {
throw new ServerErrorHttpException("Gagal menyimpan file", 500);
Expand Down

0 comments on commit a69df6f

Please sign in to comment.