Bolt\Controller\Async\FilesystemManager::deleteFile PHP Метод

deleteFile() публичный Метод

Delete a file on the server.
public deleteFile ( Request $request ) : Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request
Результат Symfony\Component\HttpFoundation\JsonResponse
    public function deleteFile(Request $request)
    {
        $namespace = $request->request->get('namespace');
        $filename = $request->request->get('filename');
        try {
            $this->filesystem()->delete("{$namespace}://{$filename}");
            return $this->json($filename, Response::HTTP_OK);
        } catch (ExceptionInterface $e) {
            $msg = Trans::__('Unable to delete file: %FILE%', ['%FILE%' => $filename]);
            $this->logException($msg, $e);
            return $this->json($msg, $e instanceof FileNotFoundException ? Response::HTTP_NOT_FOUND : Response::HTTP_INTERNAL_SERVER_ERROR);
        }
    }