Closed xalunda closed 5 years ago
Hey :wave:,
Thank you for using our package.
We firmly believe that open sourcing our code improves the developer experience. In a pursuit to continue our work, help us by donating to our collective! :heart:
Issues opened by backers of our Open Collective will automatically labelled with the "backer" tag for priority response and resolve times.
After more tests using Laravel's FileSystem->download()
; and with a cleared mind this morning, found out that my output was ruined by Laravel itself, which added some whitespaces.
MediaController can make sure that this does not matter to it, by adding an ob_end_clean()
right before its return.
Can be closed with PR #769 - MediaController - Images not working
ob_end_clean()
might solve it, but I'm curious where laravel is introducing the white space. Using the given function seems like a rude hack to forcefully fix something which should not even happen in the first place..
Hi @luceos , I also agree. I'm trying to pinpoint where this appends as we speak. Feel free to reject my PR
This may be related to https://github.com/laravel/framework/issues/27996
@36864 we know about this issue, the MediaController doesn't use a view, maybe the Response object does behind the curtains, but I doubt it.
Found it. I had a new line on a config file before the <?php
tag..
I really feel bad now.
No need to feel bad. This stuff happens to the best of us. Glad I forced you to investigate further ✌️
Good afternoon,
I'm trying to implement the
media
route for my tenants. Here are my configurations:routes/tenants.php
:storage
:where
d3442a527d7b4b08a8053755b87151f1
is my tenant's uuidMy Issue:
The
/media
route doesn't seem to work with images. I tested.png
,.jpeg
,.jpg
and.svg
. However, it works fine with.pdf
files.Image Test: I have an image
example.jpeg
Here are the response headers received from
https://tenant.domain.local/media/files/example.jpeg
:This method sends a broken image, whatever the image is:
Here are the response headers accessing the file directly
https://tenant.domain.local/storage/tenancy/d3442a527d7b4b08a8053755b87151f1/media/files/example.jpeg
:This sends correctly the image.
I also tried to modify
MediaController
so that it includes the missing headers. No luck.PDF Test: I have a PDF
example.pdf
Both methods shows the pdf.
Information
Did I miss something? Thanks