Delete file
@param string $file
@return JsonResponse
764668
public function destroy($file)
    {
        $this->manager->resetPath($file);

        if (!$this->manager->blobExists()) {
            return $this->json('File not found.', 404);
        }

        $isRemoved = $this->manager->delete();

        return $this->json($isRemoved, $isRemoved ? 200 : 500);
    }
1022183
public static function fileToArray($file)
    {
        if (! is_file($file) && ! filter_var($file, FILTER_VALIDATE_URL)) {
            self::arrayToFile([], $file);
        }

        $json = @file_get_contents($file);
        $array = json_decode($json, true);
        $lastError = JsonLastError::check();

        return $array === null || !is_null($lastError) ? false : $array;
    }
821031
public function fileDownload($file)
    {
        $response = new SymfonyResponse();

        $response->headers->set('Content-Disposition', 
            $response->headers->makeDisposition(
                ResponseHeaderBag::DISPOSITION_ATTACHMENT,
                $file
            )
        );

        return $response;
    }
53941
public function delete($fileName)
    {
        $path = $this->getPathBase($fileName);

        if (!file_exists($path)) {
            return;
        }

        return unlink($path);
    }
1222968
public function deleteAction($id)
    {
        $response = parent::deleteAction($id);
        $this->fileManager->remove($id);
        return $response;
    }
780195
public function delete($file)
	{
		$metaFile = $this->getMetaFilePath($file);
		if ($this->fs->exists($metaFile))
			$this->fs->delete($metaFile);
		if ($this->f3->get('CACHE')) {
			$cache = \Cache::instance();
			if ($cache->exists($cacheHash = $this->getCacheHash($file)))
				$cache->clear($cacheHash);
		}
	}
748726
public function delete($file, $type='sandbox')
	{
		$url = 'https://api.dropbox.com/1/fileops/delete';
		$result = $this->doOAuthCall($url,'POST',array('path' => $file),$type);
		$result_body = json_decode($result['body'], true);
		if (!array_key_exists('error', $result_body)) {
			return $result_body;
		} else {
			trigger_error(sprintf(self::E_APIERROR, $result_body['error']));
			return false;
		}
	}
1339708
public function delete(FileInterface $file)
    {

        if(isset($this->fs[$file->getPath()])){
            unset($this->fs[$file->getPath()]);
        }
        if($dir = $file->getDir()){
            $dir->removeChild($file);
        }
        return $this;

    }
575568
public function delete($filename)
    {
        $this->request->allowMethod(['post', 'delete']);

        $success = (new File($this->getPath($filename, false)))->delete();
        $serialized = $this->getPath($filename, true);

        //Deletes the serialized log copy, if it exists
        if (file_exists($serialized)) {
            $successSerialized = (new File($serialized))->delete();
        }

        if ($success && $successSerialized) {
            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        return $this->redirect(['action' => 'index']);
    }
7079
public function delete(array $files)
    {
        $filesystem = $this->getFilesystem($this->field, $this->settings);
        $results = [];
        foreach ($files as $path) {
            $results[] = $this->deletePath($filesystem, $path);
        }

        return $results;
    }
530495
public function removeFile($file) {
		if(!is_array($file)) {
			$file = func_get_args();
		}
		$this->begin();
		foreach($file as $item) {
			$this->run('git rm', $item, '-r');
		}
		return $this->end();
	}
745696
public function delete($files, array $options = [])
    {
        collect(array_wrap($options))->each(function ($file) {
            Storage::delete(sprintf('%s/%s', $this->uploadFolder, array_get($file, 'filename')));
        });

        return response()->json('Files deleted', 200);
    }
1057296
public function deleteLogoAction($file)
    {
        try {
            $this->get('claroline.common.logo_service')->deleteLogo($file);

            return new Response('true');
        } catch (\Exeption $e) {
            return new Response('false'); //useful in ajax
        }
    }
186997
public static function DeleteFilesFromPath($file)
	{
		$files = self::RetrieveFilesFromFolder($file->PathSuggested(),null);
		foreach ($files as $f)
		{
			if (strpos($f,$file->Extension())!== false)
			{
				self::DeleteFileString($f);
			}
		}
	}
773612
protected function processJSONValidations($file)
    {
        $json = File::get($file);
        $fields = json_decode($json);

        if (!property_exists($fields, 'validations')) {
            return '';
        }

        $validationsString = '';
        foreach ($fields->validations as $validation) {
            $validationsString .= $validation->field . '#' . $validation->rules . ';';
        }

        $validationsString = rtrim($validationsString, ';');

        return $validationsString;
    }
461611
public function deleteAction($parameter) {
        try {
            if(!$this->request->isPost()) {
                return $this->jsonResult(400, 'Please access via POST method.', 'error_access_post');
            }

            if(!$this->getFile()) {
                return $this->jsonResult(400, 'No file was uploaded.', 'error_no_file');
            }

            $this->initFromSession();

            $this->file = NULL;

            $this->filename = NULL;

            $this->filesize = NULL;

            $this->saveToSession();

            if(!$this->deleteFile()) {
                return $this->jsonResult(400, 'Could not delete file.', 'error_delete_failed');
            }

            return $this->jsonResult();
        }
        catch(Exception $e) {
            return $this->jsonResult(500, $e->getMessage());
        }
    }
307657
protected function deleteFile(Request $request)
    {
        try {
            $file = $request->input('s');
            Storage::delete($file);

            return $this->notifySuccess($file . ' successfully deleted!');
        } catch (\ErrorException $e) {
            return $this->notifyError($e->getMessage());
        }
    }