B
Blueprint2mo ago
Zeph

Storing files uploaded from the admin area

I have a vague idea of how to upload files provided by the user to pterodactyl, but where would the best place be to store them?
Solution:
@Zeph I've fixed extensionfs on the latest commit of Blueprint https://laravel.com/docs/10.x/filesystem/ The disk name is blueprint:identifier for files stored in domain.ext/fs/identifier...
File Storage - Laravel 10.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Jump to solution
12 Replies
Zeph
ZephOP2mo ago
just checked bp docs and I assume I have to store it in either the data directory or public directory, the thing being uploaded is a background for the main panel area, which would be the better option?
Lara
Lara2mo ago
I assume you should probably use the Laravel storage facade Pretty certain pterodactyl has at least a storage source set up by default Think it's just the file driver by default meaning it stores files in public/storage Well sorta public/storage is a symlink lmao https://laravel.com/docs/12.x/filesystem
Zeph
ZephOP2mo ago
would that be a good idea though over the addon specific folders done through blueprint?
Lara
Lara2mo ago
Oh wait I completely forgot the blueprint helper offered file storage apis
Emma
Emma2mo ago
those suck blueprint should in theory create a laravel storage driver for you automatically in practice im not sure if it works properly
Lara
Lara2mo ago
i mean i can definitely see pterodactyl does not set the public one by default
Emma
Emma2mo ago
no i mean per-extension filesystems
Lara
Lara2mo ago
and i meant that the default laravel ones aren't an option unless an install script is used to create the public driver symlinks lmao
Emma
Emma2mo ago
oh i see why im fucking stupid ok blueprint creates a config then never loads said config
Emma
Emma2mo ago
nvm it might not work yet :heavysob: will make a storage:list command to list filesystems and debug this
Solution
Emma
Emma2mo ago
@Zeph I've fixed extensionfs on the latest commit of Blueprint https://laravel.com/docs/10.x/filesystem/ The disk name is blueprint:identifier for files stored in domain.ext/fs/identifier For managing the extension's private directory, you can use the blueprint_private:identifier disk.
use Illuminate\Support\Facades\Storage;

Storage::disk('blueprint:identifier')->put('example.txt', 'file content here');
use Illuminate\Support\Facades\Storage;

Storage::disk('blueprint:identifier')->put('example.txt', 'file content here');
This will make it in the next stable release of Blueprint.
File Storage - Laravel 10.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.

Did you find this page helpful?