> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rocky.global/llms.txt
> Use this file to discover all available pages before exploring further.

# UPLOAD LIMITS CONFIG

# Configuration for File Upload Limits

## Problem

When trying to upload images larger than 2-4MB, you may receive an error message like "validation.uploaded" even though Laravel's validation allows up to 5MB.

## Root Cause

This issue is typically caused by PHP server limits being lower than Laravel's validation limits. PHP has its own upload size restrictions that must be configured separately.

## Solution

### 1. Configuration Files Updated

We have automatically updated the following files:

#### `/public/.htaccess`

```apache theme={null}
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value max_execution_time 300
php_value max_input_time 300
```

#### `/public/.user.ini`

```ini theme={null}
upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
```

### 2. If the Above Doesn't Work

If you still experience upload issues, you may need to configure PHP directly on your server.

#### For Apache with mod\_php:

Edit your server's `php.ini` file (usually located at `/etc/php/8.x/apache2/php.ini`):

```ini theme={null}
upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
```

After editing, restart Apache:

```bash theme={null}
sudo service apache2 restart
```

#### For Nginx with PHP-FPM:

Edit your PHP-FPM pool configuration (usually at `/etc/php/8.x/fpm/pool.d/www.conf`):

```ini theme={null}
php_admin_value[upload_max_filesize] = 10M
php_admin_value[post_max_size] = 10M
php_admin_value[max_execution_time] = 300
php_admin_value[max_input_time] = 300
php_admin_value[memory_limit] = 256M
```

Also update the main `php.ini` file at `/etc/php/8.x/fpm/php.ini` with the same values.

After editing, restart PHP-FPM and Nginx:

```bash theme={null}
sudo service php8.x-fpm restart
sudo service nginx restart
```

#### For Shared Hosting:

If you're on shared hosting, you may need to:

1. Contact your hosting provider to increase the limits
2. Use the `.user.ini` file we've created (some hosts support this)
3. Or use a `php.ini` file in your public directory (check with your host if this is supported)

### 3. Verification

To verify your PHP configuration, create a temporary PHP file:

```php theme={null}
<?php
phpinfo();
?>
```

Look for these values:

* `upload_max_filesize`: should be at least 10M
* `post_max_size`: should be at least 10M
* `max_execution_time`: should be at least 300
* `memory_limit`: should be at least 256M

**Important:** Delete this file after verification for security reasons.

### 4. Laravel Configuration

The Laravel validation rules have been updated in:

* `/app/Http/Controllers/Eventos/EventosController.php`

All image upload limits are now set to 5120KB (5MB):

```php theme={null}
'urlHeaderImage' => 'nullable|file|mimes:jpeg,png,jpg,gif,svg|max:5120',
'urlFooterImage' => 'nullable|file|mimes:jpeg,png,jpg,gif,svg|max:5120',
'urlThumbnailImage' => 'nullable|file|mimes:jpeg,png,jpg,gif,svg|max:5120',
```

### 5. Image Dimensions Updated

Header and footer image placeholders have been updated to support larger heights:

* **Header**: 1200×600 (previously 1200×300)
* **Footer**: 1200×600 (previously 1200×100)

### 6. Error Messages Translated

All validation error messages are now properly translated to Spanish in:

* `/resources/lang/es/validation.php`
* `/lang/es/validation.php`

## Testing

After making these changes:

1. Clear Laravel's cache: `php artisan cache:clear`
2. Clear config cache: `php artisan config:clear`
3. Restart your web server
4. Try uploading an image between 4-5MB

## Troubleshooting

If uploads still fail:

1. Check your server's error logs
2. Verify PHP configuration with `phpinfo()`
3. Check disk space on your server
4. Verify folder permissions (storage folder should be writable)
5. Check if there are any Nginx/Apache body size limits:
   * For Nginx: `client_max_body_size` in nginx.conf
   * For Apache: `LimitRequestBody` directive

## Notes

* The PHP limits (10M) are set higher than Laravel's validation (5M) to ensure uploads succeed
* Always test in a staging environment before deploying to production
* Monitor your server's performance after increasing these limits
