-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
Yes. File::setPost('field')
returns a File[] for both name="field" and name="field[]", so the same
loop handles one or many files.
From the original client file name, lower-cased. For a real upload the
temporary path (tmp_name) has no extension, so the name is the only reliable
source. See The File Object.
Yes — there is no automatic collision check. If you store two files with the
same name in the same location, the second replaces the first. Generate unique
names with rename() to avoid it;
see Recipes.
getMimeType() returns the client-declared type (spoofable).
getRealMimeType() reads the file's actual bytes with finfo. Validation and
your security checks should use the real one. See
The File Object.
No. Path-loaded files are copied by the local adapter, leaving your original in place. Only genuine HTTP uploads are moved. See Core Concepts.
false means the underlying write itself failed (e.g. the destination was not
writable, or S3 returned no ObjectURL) — not a validation problem. Validation
and backend errors throw an UploadException. Check for
both. See Error Handling.
No. $target is the object key prefix in every adapter; the S3 bucket
always comes from the credentials. (Older versions treated it as the bucket —
that changed.) See S3 Adapter.
Yes, with the allowed_max_size option (in bytes). Keep it at or below
your php.ini upload_max_filesize / post_max_size. See
Validation.
No. The core package depends only on ext-fileinfo. ext-ftp and
aws/aws-sdk-php are needed solely by their respective adapters. See
Installation.
Yes. Extend BaseUploadAdapter and implement
with() and to(). You get credential/option handling, validation
(checkFile()) and prefix building (targetName()) for free.
It works with providers reachable through the standard SDK options exposed here
(key, secret_key, region, version). Providers needing a custom endpoint
are better served by building the Aws\S3\S3Client yourself. See
Troubleshooting.
PHP 8.0 and newer. CI runs the test suite on 8.0–8.4.
No. It is a standalone Composer package with no framework coupling. Use it from plain PHP or any framework. See Recipes for integration patterns.
- Troubleshooting — concrete fixes for common errors
- Open an issue
- Discussions
initphp/upload · MIT License · part of the InitPHP family
Source · Issues · Discussions · Packagist · Contributing · Security Policy
Getting Started
Reference
Adapters
Practical Guides
Other