Uploads, Browser Resize & Naming Rules
Media ships a native browser upload engine built for large creative teams, combining client-side optimization, resumable chunked transfers, automatic filename rules, Stock Media search, and video/embed poster capture.
Upload Studio & Browser-Side Image Resize
Section titled “Upload Studio & Browser-Side Image Resize”Click Upload in the library header to open Upload Studio (UploadStudioModal):
- Browser-Side Optimization (
imageResizer.ts): Uses nativecreateImageBitmapand<canvas>.toBlob()to downscale oversized raster images (JPG,PNG,WebP) before transfer. PickOriginal,1920px,2560px,4K (3840px), or custom dimensions, tune JPEG/WebP quality (50to100%), toggle WebP conversion, or check Keep original per file. Animated GIF/WebP, SVG, PDF, video, and audio files pass through untouched. - Global Defaults (
Media::uploadClientDefaults()): Configure site-wide defaults under Setup > Media > Settings > Uploads & Privacy (client_resize_enabled,client_max_width,client_max_height,client_quality,client_convert_webp). - SHA-256 Duplicate Handling: Choose Reuse existing asset or Allow duplicate right inside Upload Studio before starting the transfer.
Persistent Upload Queue Dock & Chunked Transfers
Section titled “Persistent Upload Queue Dock & Chunked Transfers”- Upload Queue Dock (
UploadQueueDock): Stays docked while you keep browsing. Shows liveXMLHttpRequest.upload.onprogresspercentages, bytes transferred, throughput (MB/s), 3-way concurrent uploads, per-file cancel (AbortController) and retry, duplicate badges, and 1-click Inspector links. - Resumable Chunked Uploads: Files larger than 4 MB automatically split into 2 MB chunks (
upload-init,upload-chunk,upload-complete,upload-abortvia$media->chunks()) with up to 2 automatic retries per chunk. Stale incomplete sessions are pruned daily byMediaMaintenanceTask. - Clipboard Paste: Press
Cmd/Ctrl+Vanywhere in the library to upload clipboard images directly into the active folder.
Automatic Upload Filename Renaming & Storage Paths
Section titled “Automatic Upload Filename Renaming & Storage Paths”Configure naming and directory behavior under Setup > Media > Settings > Naming & Paths:
- Storage Path Mode (
upload_path_mode):date_uuid(default): ImmutableYYYY/MM/{uuid}/{file}paths so links never break when Pages or Entries are renamed.context_path: Semanticpages/{template}/{slug}/{file}orentries/{type}/{name|title|shortId}/{file}paths with automatic-2deduplication.
- Explorer Folder Mode (
upload_folder_mode): Choosefield_or_root(default) orauto_context(automatically assigns folders by template or Entry type). - Filename Renaming (
UploadNameFormatter): Enablerename_enabled, setrename_default_format, optionally cap length withrename_max_length, and add orderedmedia_rename_ruleblocks scoped by source (page,entry,library), template/type, field name, and file extensions. Supported tokens:{original},{name},{title},{template},{type},{field},{folder}[Y-m-d](any PHPdate()format),randstring[n], and###zero-padded sequential counters.- Leave
filename_formatblank on a matching rule to keep the original filename.
Built-In Stock Media & Video/Embed Posters
Section titled “Built-In Stock Media & Video/Embed Posters”- Stock Media Providers (
Unsplash,Pexels,Pixabay): Add write-only API keys under Settings > Stock Media & Labels to search and import licensed photos directly into your library with attribution metadata ($media->stock()->search('unsplash', 'coast')/$media->stock()->import(...)). Register custom providers viaMedia::registerStockProviders. - YouTube / Vimeo Embeds & Custom Posters: Import external videos via
$media->importUrl('https://www.youtube.com/watch?v=...')or the Embed tab inMediaAcquisitionModal. Local video uploads capture a browser-side JPEG poster frame automatically (videoPoster.ts, zeroffmpegrequired), and embeds cache local oEmbed thumbnails. Editors can upload or reset a custom poster (<= 1280px,_posters/{asset_id}.jpgviaattachPoster()/removePoster()) exposed uniformly through$asset->posterUrl()and privacy-friendly$asset->embedHtml(['facade' => true]).