How is possible use LiiImagineBundle for private image files
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.7k
- Forks
- 386
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 3
Description
In my Symfony application, user can upload images but images are stored in non public directory, in my case I store this in /var/card-upload. For display images in templateI use this controller method with
```
fileServe($card->getImage());
}
/**
* Returns a private file for display.
*
* @param string $path
* @return BinaryFileResponse
*/
private function fileServe(string $path): BinaryFileResponse
{
$absolutePath = $this->getParameter('card_directory') . '/' . $path;
return new BinaryFileResponse($absolutePath);
}
}
```
Now I dont how I can this BinaryFileResponse filter by using LiipImagineBundle. It is posiible?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ServePrivateImageController and its privateImageServe method, then review how BinaryFileResponse serves files from /var/card-upload. Determine how LiipImagineBundle should transform a private image while preserving access control, and consider the request complete when the transformed image can be displayed from the private directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100