File upload Error in production

Hi community, I need a help on my problem i did : - the storage link - giving the right permission to the www-data - set the right url in env - increase the php limit but i got thit by The mountedActionsData.0.photos.58524194-e822-43c6-b894-fb6b06a72306 failed to upload. error, when trying to upload files on production server, this is my code
Section::make('Media')
->icon('heroicon-o-photo') // Add icon to section
->description('Upload photos of the WiFi equipment.')
->schema([
FileUpload::make('photos')
->image()
->panelLayout('grid')
->reorderable()
->appendFiles()
->openable()
->downloadable()
->multiple()
->maxParallelUploads(10)
->directory('wifi-photos')
->imageResizeMode('cover')
->imageCropAspectRatio('16:9')
->imageResizeTargetWidth('1920')
->imageResizeTargetHeight('1080')
->required()
]),
Section::make('Media')
->icon('heroicon-o-photo') // Add icon to section
->description('Upload photos of the WiFi equipment.')
->schema([
FileUpload::make('photos')
->image()
->panelLayout('grid')
->reorderable()
->appendFiles()
->openable()
->downloadable()
->multiple()
->maxParallelUploads(10)
->directory('wifi-photos')
->imageResizeMode('cover')
->imageCropAspectRatio('16:9')
->imageResizeTargetWidth('1920')
->imageResizeTargetHeight('1080')
->required()
]),
what could possily goes wrong
No description
Solution:
i found the error, it was allow trusted proxy since im using reverse proxy :>
Jump to solution
3 Replies
waterflai
waterflaiOP2w ago
when i do this
Route::get('/test-upload', function () {
// Sample file content
$content = "This is a test file uploaded via GET route.";

// Define the file path inside storage
$filePath = 'test-uploads/sample.txt';

// Store the file
Storage::disk('public')->put($filePath, $content);

// Return success response with file URL
return response()->json([
'message' => 'File uploaded successfully!',
'file_url' => Storage::url($filePath),
]);
});
Route::get('/test-upload', function () {
// Sample file content
$content = "This is a test file uploaded via GET route.";

// Define the file path inside storage
$filePath = 'test-uploads/sample.txt';

// Store the file
Storage::disk('public')->put($filePath, $content);

// Return success response with file URL
return response()->json([
'message' => 'File uploaded successfully!',
'file_url' => Storage::url($filePath),
]);
});
it works, means the current user has permission to upload files to the storage Up :<
dissto
dissto2w ago
If you are using nginx, it may be worth checking your client_max_body_size 🤔
Solution
waterflai
waterflai2w ago
i found the error, it was allow trusted proxy since im using reverse proxy :>

Did you find this page helpful?