Track an upload status
@param int $FileUploadId
@return models\FileSystem\FileUpload
@deprecated use v4 service
761693
public function getFromId( $FileUploadId){
        $rest = $this->getService( self::API_UPLOAD . $FileUploadId);
        $rest->GET();

        return $rest->getResult( models\FileSystem\FileUpload::class);
    }
1190049
public function saveFileToTmpDir($fileId)
    {
        $baseTmpPath = $this->getBaseTmpPath();

        $uploader = $this->uploaderFactory->create(['fileId' => $fileId]);
        $uploader->setAllowedExtensions($this->getAllowedExtensions());
        $uploader->setAllowRenameFiles(true);
        $uploader->setFilesDispersion(true);

        $result = $uploader->save($this->mediaDirectory->getAbsolutePath($baseTmpPath));

        if (!$result) {
            throw new LocalizedException(
                __('File can not be saved to the destination folder.')
            );
        }
        /**
         * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS
         */
        $result['tmp_name'] = str_replace('\\', '/', $result['tmp_name']);
        $result['path'] = str_replace('\\', '/', $result['path']);
        $result['url'] =  $this->getBaseUrl() . $this->getFilePath($baseTmpPath, $result['file']);

        if (isset($result['file'])) {
            try {
                $relativePath = rtrim($baseTmpPath, '/') . '/' . ltrim($result['file'], '/');
                $this->coreFileStorageDatabase->saveFile($relativePath);
            } catch (\Exception $e) {
                $this->logger->critical($e);
                throw new LocalizedException(
                    __('Something went wrong while saving the file(s).')
                );
            }
        }

        return $result;
    }
988436
public function downloadAction($storageId)
    {
        $fileManager = $this->get('beaast.core.manager.file');

        /**
         * @var File $file
         */
        $file = $fileManager->findOneBy(['storageId' => $storageId]);

        if (!$file) {
            throw $this->createNotFoundException();
        }

        $filePath = $fileManager->getFilePath($file);

        return new BinaryFileResponse($filePath, 200, [
            'Cache-Control'     => 'private',
            'Content-Type'     => $file->getMimeType(),
            'Content-length'     => $file->getSize(),
            'Content-Disposition' => 'attachment; filename="'.$file->getFileName().'"',
        ]);
    }
442441
public function cancelFromId( $FileUploadId){
        $Service = sprintf( self::API_UPLOAD_CANCEL, $FileUploadId);
        $rest = $this->getService( $Service);
        $rest->DELETE();

        return $rest->getSuccess();
    }
812465
protected function getUploadDir($sFieldId)
    {
        // Default upload dir
        $sDefaultUploadDir = $this->getOption('upload.default.dir');
        $sUploadDir = $this->getOption('upload.files.' . $sFieldId . '.dir', $sDefaultUploadDir);
        $sUploadDir = rtrim(trim($sUploadDir), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        // Verify that the upload dir exists and is writable
        if(!is_writable($sUploadDir))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.upload.access'));
        }
        $sUploadDir .= $this->sUploadSubdir;
        if(!@mkdir($sUploadDir))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.upload.access'));
        }
        return $sUploadDir;
    }
383633
public function uploadProjectAsync($writerId, $incrementalLoad = null, $queue = 'primary')
    {
        return $this->getCommand('UploadProject', [
            'writerId' => $writerId,
            'incrementalLoad' => $incrementalLoad,
            'queue' => $queue
        ])->execute();
    }
605514
public function trackDownload($rcID = null)
    {
        $u = new User();
        $uID = intval($u->getUserID());
        $fv = $this->getApprovedVersion();
        $fvID = $fv->getFileVersionID();
        if (!isset($rcID) || !is_numeric($rcID)) {
            $rcID = 0;
        }

        $fve = new \Concrete\Core\File\Event\FileAccess($fv);
        Events::dispatch('on_file_download', $fve);

        $config = Core::make('config');
        if ($config->get('concrete.statistics.track_downloads')) {
            $db = Loader::db();
            $db->Execute(
                'insert into DownloadStatistics (fID, fvID, uID, rcID) values (?, ?, ?, ?)',
                [$this->fID, intval($fvID), $uID, $rcID]
            );
        }
    }
1309810
public function download($attachmentId = null)
    {
        $attachment = $this->Attachments->get($attachmentId);

        $this->_checkAuthorization($attachment);

        $this->response->file($attachment->getAbsolutePath(), [
            'download' => true,
            'name' => $attachment->filename
        ]);
        return $this->response;
    }
930404
public function finishUpload($uploadId,$fileOffset,$content)
    {
        $qry = new InvokePostMethodQuery($this->getResourcePath(),
            "finishupload",
            array('uploadId' => $uploadId->toString(),'fileOffset' => $fileOffset),
            $content);
        $this->getContext()->addQuery($qry,$this);
        return $this;
    }
341994
public function status($transactionId)
    {
        $xml = new DOMDocument();
        $transaction = $xml->createElement('hps:Transaction');
        $status = $xml->createElement('hps:GetTransactionStatus');

        $status->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));

        $transaction->appendChild($status);
        return $this->_submitTransaction($transaction, 'GetTransactionStatus');
    }
1200712
public function get_file_info($fileid) {
        $this->reset_state();
        $result = $this->request($this->make_url("/files/$fileid"));
        return json_decode($result);
    }
584747
public static function getUploadErrorMessage($errorId)
    {
        $messagesArray = self::getUploadErrorMessages();
        return isset($messagesArray[$errorId]) ? $messagesArray[$errorId] : 'Unknown upload error.';
    }
571822
public function uploadAction($folderId, Request $request)
    {
        $uploadedFile = $request->files->get('file');
        $title = $request->get('title');

        $saveMediaManager = $this->get('open_orchestra_media_admin.manager.save_media');

        if ($uploadedFile && $uploadedFile = $saveMediaManager->getFileFromChunks($uploadedFile)) {
            $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
            $media = $saveMediaManager->initializeMediaFromUploadedFile($uploadedFile, $folderId, $siteId, $title);
            $violations = $this->get('validator')->validate($media, null, array('upload'));
            if (count($violations) !== 0) {
                return new Response(
                    implode('.', $this->getViolationsMessage($violations)),
                    403
                );
            }

            $saveMediaManager->saveMedia($media);

            return $this->get('open_orchestra_api.transformer_manager')->transform('media', $media);

        }

        return new Response('', 202);
    }
264519
public function getActivityUploadStatus($id)
    {
        try {
            return $this->service->getActivityUploadStatus($id);
        } catch (ServiceException $e) {
            throw new ClientException('[SERVICE] ' . $e->getMessage());
        }
    }
341874
public function setUploadFileSourceId($sourceId)
    {
        
    	$ext = common_ext_ExtensionsManager::singleton()->getExtensionById('tao');
    	$ext->setConfig(self::CONFIG_UPLOAD_FILESOURCE, $sourceId);
        
    }
667743
def upload_status(self, upload_id):
        """"""

        path = '/api/1.0/upload/status'
        query = 'id={}'.format(upload_id)
        return self._api_get(definition.DatasetUploadStatusResponse, path, query)
884713
public function uploadFile( $FileUploadTaskId, $fileToUpload_afi){
        $Service = sprintf( self::API_UPLOAD_SEND, $FileUploadTaskId);
        $rest = $this->getService( $Service);
        $rest->setContentType_MultipartFormData();
        $rest->POST([
            basename( $fileToUpload_afi) => new \CurlFile( $fileToUpload_afi),
        ]);

        return $rest->getSuccess();
    }