Skip to content

3.2.0

Choose a tag to compare

@mydoxie mydoxie released this 13 Nov 10:48
· 5 commits to main since this release
26c6f3b

New

  • dox add storage [--disk=local|s3] writes the config, the provider, the storage folder and the .env keys. 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) and putFileAs(folder, file, name).
  • copy, move, files, allFiles, directories, deleteDirectory, missing, getVisibility and setVisibility are on Storage(). deleteDirectory refuses 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 with dart run skills@ get.
  • New dependency: dox_annotation.

Fixes

  • copy() and move() of a missing file made the new folders first. They now throw FileNotFoundException and make nothing.
  • size() and lastModified() of a missing file gave a 500. They now give a 404.
  • storeAs() and putRequestFileAs() 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