Detailed configuration options for the Upload and Shorten Advanced plugin.
Access the settings via: Admin Panel → Plugins → Upload Settings
| Setting | Description | Default | Notes |
|---|---|---|---|
| Max File Size | Maximum file size for uploads | 10 MB | Can be increased up to PHP’s upload_max_filesize limit |
| Allowed File Types | Comma-separated list of allowed extensions | jpg,jpeg,png,gif,pdf,doc,docx,txt,zip | Case-insensitive |
| File Retention | How long to keep files before deletion | Never | Options: Never, 24 Hours, 7 Days, 31 Days, 90 Days, Custom |
| Storage Location | Directory where files are stored | /uploads/ |
Must be web-accessible and writable |
| Setting | Description | Default | Notes |
|---|---|---|---|
| Frontend Uploads | Allow public users to upload files | Disabled | Enable with caution |
| Frontend Max Size | Maximum file size for frontend uploads | 5 MB | Should be lower than admin limit |
| Frontend File Types | Allowed file types for frontend uploads | jpg,jpeg,png,gif,pdf,txt | Should be more restrictive than admin |
Configure all plugin settings from the intuitive admin interface
The plugin supports multiple storage locations for organizing your files.
Configure automatic file cleanup to manage storage space.
The plugin includes a built-in cleanup routine that runs when:
For more reliable cleanup, set up a cron job:
# Add to your crontab
0 2 * * * /usr/bin/php /path/to/yourls/user/plugins/YOURLS-Upload-and-Shorten-Advanced/cleanup.php
The plugin includes multiple security layers to protect your installation.
Files are validated on multiple levels:
The following extensions are always blocked for security:
.exe, .com, .bat, .cmd, .sh.php, .asp, .aspx, .jsp, .py, .rb.jar, .war.dll, .so, .dylibThe plugin automatically creates a .htaccess file in the upload directory with:
# Prevent PHP execution
<Files *.php>
deny from all
</Files>
# Block dangerous file types
<FilesMatch "\.(exe|com|bat|cmd|sh|dll|so|dylib)$">
deny from all
</FilesMatch>
# Allow only specified file types
<FilesMatch "\.(jpg|jpeg|png|gif|pdf|doc|docx|txt|zip)$">
Allow from all
</FilesMatch>
Ensure your PHP configuration supports file uploads:
file_uploads = On
upload_max_filesize = 20M # Adjust as needed
post_max_size = 25M # Should be larger than upload_max_filesize
max_execution_time = 300 # For large file uploads
memory_limit = 256M # For processing large files
You can check your current PHP limits in the Upload Settings page, which displays:
The plugin creates two database tables:
yourls_upload_files - Stores file metadatayourls_upload_settings - Stores plugin configurationThese tables are created automatically on plugin activation.