404 error with custom urls #2478
Unanswered
maximus1127
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have added a private folder in my storage directory. It is
storage/app/encounter_uploads
. I am successfully saving to this location using$encounter->addMedia($request->file('file'))->usingName($request->documentCategory)->toMediaCollection('uploads', 'private');
This saves the file to my "private" disk which I've defined in my filesystem.php file in the config directory.
My issue is that when I try to retrieve the file, I get a 404 error. I've tried to change the
getUrl()
function to match my root but that still doesn't work. Here is my attempted method rewrite:This correctly returns the exact path of my file, however it still gives a 404 when I put that URL as the href of an tag. I can't use a symlink here as these are private files that I don't want being accessible via the public folder. I realize that may be my issue and if it is, can someone point me in the right direction on accessing files in a private directory that is not sym-linked to the public folder?
Beta Was this translation helpful? Give feedback.
All reactions