Delete the file from the Livedocx service

@return Image

@throws DeleteException
7545
public function delete()
    {
        try {
            $this->getSoapClient()->DeleteImage([
                'filename' => basename($this->getName(true)) ,
            ]);

            return $this;
        } catch ( SoapException $e ) {
            throw new DeleteException('Error while deleting the image' , $e);
        }
    }
144599
public function deleteImage()
    {
        if ($filename = Setting::where('key_name', 'image')->value('value')) {
            try {
                Croppa::delete('storage/settings/'.$filename);
            } catch (Exception $e) {
                Log::info($e->getMessage());
            }
        }
        Setting::where('key_name', 'image')->delete();
        $this->repository->forgetCache();
    }
612236
public function delete()
    {
        try {
            $this->getClient()->delete($this->getUrl());
        } catch (ClientException $e) {
            $statusCode = $e->getResponse()->getStatusCode();

            if (HttpResponse::HTTP_NOT_FOUND === $statusCode || HttpResponse::HTTP_GONE === $statusCode) {
                throw new FileException('File not found.');
            }
        }
    }
998807
public function deleteFile()
    {
        $retval = false;

        if (($nb_icontact_prospect = $this->getIContactProspect()) instanceof CNabuIContactProspect &&
            ($nb_icontact = $nb_icontact_prospect->getIContact()) instanceof CNabuIContact
        ) {
            $base_path = $nb_icontact->getBasePath();
            $filename = $base_path . DIRECTORY_SEPARATOR . $this->getFilename();

            if (file_exists($filename)) {
                unlink($filename);
                $retval = !file_exists($filename);
            }
        }

        return $retval;
    }
626273
public function delete()
    {
        $path = $this->model->getPath('destroy');

        return $this->query->from($path)
                ->delete();
    }
644828
public function delete()
    {
        if (!$this->url)
        {
            throw new AVException("Cannot delete file that has not been saved.");
        }

        $headers = AVClient::_getRequestHeaders(null, true);
        $url = AVClient::HOST_NAME . '/files/' . $this->getName();
        $rest = curl_init();
        curl_setopt($rest, CURLOPT_URL, $url);
        curl_setopt($rest, CURLOPT_CUSTOMREQUEST, "DELETE");
        curl_setopt($rest, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($rest, CURLOPT_HTTPHEADER, $headers);
        $response = curl_exec($rest);
        $contentType = curl_getinfo($rest, CURLINFO_CONTENT_TYPE);
        if (curl_errno($rest))
        {
            throw new AVException(curl_error($rest), curl_errno($rest));
        }
        curl_close($rest);
    }
51256
public function delete()
    {
        if ($this->files->exists($path = $this->manifestPath.'/collections.json'))
        {
            return $this->files->delete($path);
        }
        else
        {
            return false;
        }
    }
392826
public function delete()
  {
    $file = $this->file;

    if (file_exists($file)) return Filesystem::delete($file);

    return false;
  }
641338
public function deleteStorgaFile()
    {
        if (!$this->onDeleteCascade) {
            return $this;
        }


        if ($this->relations) {
            foreach ($this->relations as $data) {
                $fieldName = ArrayHelper::getValue($data, 'property');

                if ($fileIds = $this->owner->{$fieldName}) {
                    if ($storageFiles = CmsStorageFile::find()->where(['id' => $fileIds])->all()) {
                        foreach ($storageFiles as $file) {
                            $file->delete();
                        }

                    }
                }
            }
        }

        if ($this->fields) {
            foreach ($this->fields as $fieldName) {

                if ($fileIds = $this->owner->{$fieldName}) {
                    if ($storageFiles = CmsStorageFile::find()->where(['id' => $fileIds])->all()) {
                        foreach ($storageFiles as $file) {
                            $file->delete();
                        }
                    }
                }
            }
        }

    }
1147229
public function delete($id)
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		try {
			$imageService = $this->getServiceLocator()->get('document.service.image');
			$document = $imageService->delete($id);
			$data = array(
				'status' => 'success',
				'message' => "Deleted " . $id
			);
		} catch(\Exception $e) {
			$this->getResponse()
				->setStatusCode(Response::STATUS_CODE_500);
			$data = array(
				'status' => 'danger',
				'message' => $e->getMessage() 
			);
		}
		
		return new JsonModel($data);
	}
314908
public function actionDelete()
    {
        if(Yii::$app->request->isAjax)
        {
            $file_id = Yii::$app->request->post('file_id');
            $oneFile = OneFile::findOne($file_id);
            $modelName = $oneFile->model;
            $model = $modelName::findOne($oneFile->parent_id);

            $model->deleteFile($oneFile->name, $oneFile->subdir);
            $oneFile->delete();
            
            echo $file_id;
        }
    }
839579
public function destroy()
    {
        $sizes = config('avored-framework.image.sizes');

        foreach ($sizes as $sizeName => $widthHeight) {
            $baseName = basename($this->dbPath);
            $sizeNamePath = str_replace($baseName, $sizeName . '-' . $baseName, $this->dbPath);

            $path = public_path($sizeNamePath);
            File::delete($path);
        }

        $path = public_path($this->dbPath);
        File::delete($path);

        return $this;
    }
1057392
public function delete() {
        $url = "entities";

        if ($this->_id) {
            $url .= "/{$this->_id}";
        }

        if ($this->_type) {
            $url .= "?type={$this->_type}";
        }

        return $this->_orion->delete($url);
    }
152259
public function removePortraitImage()
    {
        $sizes = $this->_mixer->getValue('sizes');

        if (empty($sizes)) {
            $sizes = explode(' ', 'original large medium small thumbnail square');
        } else {
            $sizes = array_keys($sizes);
        }

        foreach ($sizes as $size) {
            $file = $this->_mixer->getPortraitFile($size);
            $this->_mixer->deletePath($file);
        }

        $this->set('filename', null);
    }
742261
public function deleteStorgaFile()
    {
        if (!$this->onDeleteCascade) {
            return $this;
        }

        foreach ($this->fields as $fieldValue) {
            if ($fileId = $this->owner->{$fieldValue}) {
                if ($storageFile = CmsStorageFile::findOne($fileId)) {
                    $storageFile->delete();
                }
            }
        }
    }
283682
public function deleteMedia()
    {
        $mediaMapper = ($this->container->dataMapper)('MediaMapper');

        // Get the media record
        if (null !== $id = $this->request->getParsedBodyParam('id')) {
            $mediaFile = $mediaMapper->findById($id);

            if (is_string($mediaFile->file)) {
                $rootDir = substr($mediaFile->file, 0, 2);
                $this->deleteRecursive(ROOT_DIR . 'public/media/' . $rootDir);

                $mediaMapper->delete($mediaFile);
            }
        }

        // Set the response type
        if ($this->request->isXhr()) {
            $r = $this->response->withHeader('Content-Type', 'application/json');
            return $r->write(json_encode(["status" => "success"]));
        }

        return $this->redirect('adminShowMedia');
    }
1288053
public function deleteFile()
    {
        if ($this->file) {
            if (file_exists($this->file)) {
                if (false === @unlink($this->file)) {
                    throw FileException::lastError();
                }
            }

            if (file_exists($this->file . '.pubkey')) {
                if (false === @unlink($this->file . '.pubkey')) {
                    throw FileException::lastError();
                }
            }

            $dir = dirname($this->file);

            if (file_exists($dir)) {
                if (false === @rmdir($dir)) {
                    throw FileException::lastError();
                }
            }

            $this->file = null;
        }
    }