mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Merge pull request #787 from christyjacob4/fix-na-deprecate-as-option
Fix: deprecate the $as option
This commit is contained in:
commit
ee56a016e6
1 changed files with 1 additions and 9 deletions
|
|
@ -425,10 +425,9 @@ App::get('/v1/storage/files/:fileId/view')
|
|||
->label('sdk.response.type', '*/*')
|
||||
->label('sdk.methodType', 'location')
|
||||
->param('fileId', '', new UID(), 'File unique ID.')
|
||||
->param('as', '', new WhiteList(['pdf', /*'html',*/ 'text'], true), 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true)
|
||||
->inject('response')
|
||||
->inject('projectDB')
|
||||
->action(function ($fileId, $as, $response, $projectDB) {
|
||||
->action(function ($fileId, $response, $projectDB) {
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Appwrite\Database\Database $projectDB */
|
||||
|
||||
|
|
@ -470,13 +469,6 @@ App::get('/v1/storage/files/:fileId/view')
|
|||
$output = $compressor->decompress($source);
|
||||
$fileName = $file->getAttribute('name', '');
|
||||
|
||||
$contentTypes = [
|
||||
'pdf' => 'application/pdf',
|
||||
'text' => 'text/plain',
|
||||
];
|
||||
|
||||
$contentType = (\array_key_exists($as, $contentTypes)) ? $contentTypes[$as] : $contentType;
|
||||
|
||||
// Response
|
||||
$response
|
||||
->setContentType($contentType)
|
||||
|
|
|
|||
Loading…
Reference in a new issue