Issue in Media Library Plugin at the time of upload image

When i upload image or any file it give the error
No description
23 Replies
Hasan Tahseen
Hasan Tahseen7d ago
check the logs in your laravel.log and also check the network response for it to debug it more.
igorclauss
igorclauss7d ago
Most of the times for me it was a permission issue.
Boa Hancock
Boa Hancock7d ago
there is a 401 error, the problem occurs when switching to the octane server
Muhammad Umar Mughal Azeemi
i run this project as a local
Boa Hancock
Boa Hancock7d ago
@Muhammad Umar Mughal Azeemi Can you also share the console.log messages?
No description
Majid Al Zariey
You might be missing the default structure of files in the storage folder ->storage ->app ->public
Muhammad Umar Mughal Azeemi
in my filesystem config file this path set 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', 'throw' => false, ], but it cannot fix the error
Majid Al Zariey
Check the files in your project,
Muhammad Umar Mughal Azeemi
error change and this error show please tell me how to fix this issue
No description
Boa Hancock
Boa Hancock6d ago
Can you verify if there are any temporary files inside the livewire-tmp that you uploaded?
No description
Majid Al Zariey
what about the console logs?
Muhammad Umar Mughal Azeemi
thats the main issue no file uploaded in temporary directory because of issue as you see in image
LeandroFerreira
add this to create page:
public function mount(): void
{
dump(tmpfile());
parent::mount();
}
public function mount(): void
{
dump(tmpfile());
parent::mount();
}
what is the output?
Muhammad Umar Mughal Azeemi
stream resource @34 ▼ // app/Filament/Pages/UploadChallan.php:58 timed_out: false blocked: true eof: false wrapper_type: "plainfile" stream_type: "STDIO" mode: "r+b" unread_bytes: 0 seekable: true uri: "/tmp/phpptHVgu" options: [] } this output show
LeandroFerreira
share the FileUpload component code in your form schema Is it a custom page?
Muhammad Umar Mughal Azeemi
SpatieMediaLibraryFileUpload::make('media') ->required() ->collection(User::MEDIA_COLLECTION) ->model($this->user) yes
LeandroFerreira
share the whole code please you can use github gist
LeandroFerreira
if you use this, what happens when you upload a file?
FileUpload::make('media')
->required()
->model($this->user)
FileUpload::make('media')
->required()
->model($this->user)
Muhammad Umar Mughal Azeemi
nothing any affect
LeandroFerreira
try to config trusted proxies
HTTP Requests - Laravel 12.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.
Muhammad Umar Mughal Azeemi
its not working and i more thing the issue face in live server in ubuntu with nginx i face issue in local but it can solve just given temporary path in .phpini file but in local i face path issue and it resolved but in live server issue change and it cannot solve this issue face in live server

Did you find this page helpful?