how to make uploaded image only visible inside the filament admin panel
I have a filament form outside the admin panel where fotos can be uploaded. What do i have to do that the photos are not public visible, but only from INSIDE the Admin Panel?
If i put it to 'public' disk, the image is accesible via public url. And i can see it the filament admin panel. If i put it to 'local' disk, the file is not appearing in the filament admin panel.
10 Replies
visibility private, maybe?
i have tried that. But the filename appears in grey and it doesn't load it.
What do you mean it appears in gray.?
youre probably loading the file incorrectly
you only need to pass in the file name to fill(), not the whole URL
console errors will probably tell you whats wrong
Thanks very much for your answers @awcodes and @Dan Harrin
Here all details:
I have a external form (not in admin panel) where unregistered users can upload a Photo. Then in the Filament Admin Panel i want to see/edit the photo. I use the same code for both upload fields (in the two forms).
I use this filesystems.php config 1. sreenshot
I use this code in my external form and in the admin panel form: 2. sreenshot
Uploaded image in external form builder form. 3. sreenshot
dd of uploaded imagename 4. sreenshot
Proof that image is in local file system 5. screenshot
and 6. sreenshot: the grey field instead of the image in the form in the admin panel.
Any idea how i could resolve that?
I want the image only be visible in the admin panel (loged in admin user) and not via url from external .
Thanks for any help.
check console errors on the form that doesnt show images properly
console error: Failed to load resource: the server responded with a status of 404 ()
send the URL its trying to fetch
check the network tab
I think you have to use a temporary url to access files from not public disk.
I also have a problem with private file visibility: I need to have file access only for authorized users, too. If I set the disk to 'local' and visibility to 'private', the file is saved correctly, but I can't open it with an 404 error. filesystems.php has not changed from my side. Have I missed something?