Repository navigation
Releases
Releases · dartondox/dox-storage
3.2.1
Fixes
storage:installwritesstorage/appas the root of the local disk. Before, it wrotestorage, so an unsignedStorage.routecould also serve other folders there, like the file cache instorage/cache.
An app installed before is not changed. If it has an unsigned Storage.route, set the disk root to a folder that holds only public uploads.
Full list: CHANGELOG
3.2.0
New
dox add storage [--disk=local|s3]writes the config, the provider, thestoragefolder and the.envkeys. It never overwrites a file.Storage().put(path, contents, exact: true)writes to that exact path and replaces an old file.Storage().putFile(folder, file)andputFileAs(folder, file, name).copy,move,files,allFiles,directories,deleteDirectory,missing,getVisibilityandsetVisibilityare onStorage().deleteDirectoryrefuses the root, so a bad path cannot empty a disk.Storage().download(path, name: 'Invoice 42.pdf')sets the file name the browser saves.- Local disk option
permissions: true: visibility is the real file mode (public 0644, private 0600). It is off by default. A private file is never open to others while it is written. - Ships an AI agent skill (
dox-storage-guide). Install it withdart run skills@ get. - New dependency:
dox_annotation.
Fixes
copy()andmove()of a missing file made the new folders first. They now throwFileNotFoundExceptionand make nothing.size()andlastModified()of a missing file gave a 500. They now give a 404.storeAs()andputRequestFileAs()returned the raw name, not the stored path.directoryExists('')was true on a local disk and false on S3 and memory disks. It is now true everywhere.- A copy on a local disk is written to a temp file and renamed, so it can never empty its own source.
Do not pass the raw client file name to storeAs(). Make your own name.
Docs: File storage
Full list: CHANGELOG
3.1.0
No breaking change. Signed URLs made before this version still work until they expire.
New
directoryExists(),size(),lastModified(),makeDirectory().append()andprepend()add text to a file.temporaryUrl(), the Laravel name forsignedUrl().assertExists()andassertMissing()for tests on a fake disk.file.store(folder, disk: 's3')andfile.storeAs(folder, name).atomic_writes: a failed upload never leaves a partial file.
await file.store('avatars', disk: 's3');
drive.fake('s3').assertExists('a.png');Fixes
url()on a local disk with nourloption now gives/storage/<path>. Before, it threw.- New signed URLs include the disk name, so they only work on their own disk. They do not work on 3.0.1 after a downgrade.
- Long file names with
atomic_writesno longer fail. append()andprepend()no longer fail when another writer deletes the file.
Docs: File storage, Storage package
Full list: the CHANGELOG.
3.0.1
Fix
Storage.route()decoded the file key twice. A key with a real%, like100%.txt, gave the wrong file or a500.
Needs dox_core 3.0.1 or newer.