Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Returning user uploaded file using custom controller #1029

Open
Assignees
@chattago2002

Description

Hi everybody.

I made a custom controller to handle file uploads and I'd like to add the capability to return the file via API made using this repository.
In the function __construct function I added:

$router->register('GET', '/records/file/*', array($this, 'getFileV2'));

In

public function getFileV2(ServerRequestInterface $request): ResponseInterface

I need to get the file, decrypt (because in POST controller function the file is correctly uploaded as encrypted) but also if I add

header("Content-Type: image/png");
return $decryptedFile;

I can't view the file and the error message is:

UploadUserFile::getFileV2(): Return value must be of type Psr\\Http\\Message\\ResponseInterface, string returned

How can I do this?

Metadata

Metadata

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /