Delete attachment's file on disk
This commit is contained in:
parent
873d25c742
commit
9dd1c92c6f
@ -27,11 +27,11 @@ class Uploads extends Controller
|
||||
}
|
||||
|
||||
// Get file path
|
||||
if (!$path = $this->getMediaPathOnStorage($media)) {
|
||||
if (!$this->getMediaPathOnStorage($media)) {
|
||||
return response(null, 204);
|
||||
}
|
||||
|
||||
return $this->streamMedia($media, $path);
|
||||
return $this->streamMedia($media);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ class Uploads extends Controller
|
||||
}
|
||||
|
||||
// Get file path
|
||||
if (!$path = $this->getMediaPathOnStorage($media)) {
|
||||
if (!$this->getMediaPathOnStorage($media)) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'error' => true,
|
||||
@ -108,11 +108,11 @@ class Uploads extends Controller
|
||||
}
|
||||
|
||||
// Get file path
|
||||
if (!$path = $this->getMediaPathOnStorage($media)) {
|
||||
if (!$this->getMediaPathOnStorage($media)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->streamMedia($media, $path);
|
||||
return $this->streamMedia($media);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,10 +100,10 @@ trait Uploads
|
||||
return false;
|
||||
}
|
||||
|
||||
return Storage::path($path);
|
||||
return $path;
|
||||
}
|
||||
|
||||
public function streamMedia($media, $path = '')
|
||||
public function streamMedia($media)
|
||||
{
|
||||
return response()->streamDownload(
|
||||
function() use ($media) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user