UploadFactory
final class UploadFactory (View source)
Exposes request-scoped uploaders whose named profiles are resolved against the current application context.
Profile failures are translated into upload validation errors before storage is attempted.
Methods
Binds resolved profile configuration to the request and its public or private storage boundary.
Creates a generic uploader for a configured profile without reading request input yet.
Creates an image uploader for a configured profile without reading request input yet.
Resolves one request upload by input name and stores it through the selected generic profile.
Resolves one request upload by input name and stores it through the selected image profile.
Wraps an already-resolved generic policy in an uploader without consulting named configuration.
Wraps an already-resolved image policy in an uploader without consulting named configuration.
Resolves and stores one request upload using a caller-supplied generic policy.
Resolves and stores one request upload using a caller-supplied image policy.
Resolves a named generic profile into visibility-constrained absolute and storage-relative paths.
Resolves a named image profile into visibility-constrained absolute and storage-relative paths.
Details
__construct
__construct(UploadConfig $config, UploadService $service, ServerRequestInterface $request, TranslatorInterface $translator, ApplicationContext $context, UploadPathPolicy|null $pathPolicy = null)
Binds resolved profile configuration to the request and its public or private storage boundary.
file
ConfiguredFileUploader
file(string $profile = 'default')
Creates a generic uploader for a configured profile without reading request input yet.
image
ConfiguredImageUploader
image(string $profile = 'default')
Creates an image uploader for a configured profile without reading request input yet.
upload
UploadedFile
upload(string $inputName, string $profile = 'default')
Resolves one request upload by input name and stores it through the selected generic profile.
uploadImage
UploadedImage
uploadImage(string $inputName, string $profile = 'default')
Resolves one request upload by input name and stores it through the selected image profile.
fileWithOptions
ConfiguredFileUploader
fileWithOptions(FileUploadOptions $options)
Wraps an already-resolved generic policy in an uploader without consulting named configuration.
imageWithOptions
ConfiguredImageUploader
imageWithOptions(ImageUploadOptions $options)
Wraps an already-resolved image policy in an uploader without consulting named configuration.
uploadWithOptions
UploadedFile
uploadWithOptions(string $inputName, FileUploadOptions $options)
Resolves and stores one request upload using a caller-supplied generic policy.
uploadImageWithOptions
UploadedImage
uploadImageWithOptions(string $inputName, ImageUploadOptions $options)
Resolves and stores one request upload using a caller-supplied image policy.
fileOptions
FileUploadOptions
fileOptions(string $profile = 'default')
Resolves a named generic profile into visibility-constrained absolute and storage-relative paths.
imageOptions
ImageUploadOptions
imageOptions(string $profile = 'default')
Resolves a named image profile into visibility-constrained absolute and storage-relative paths.