# observe\_filestore\_request/2

Source: https://zotonic.com/docs/3139/observe_filestore_request-2

URI: https://zotonic.com/id/3139

Language: en



Perform a direct, synchronous filestore upload, download or deletion.

Type: [first](/id/doc_developerguide_notifications#notification-first).

Unlike `#filestore{action=upload}`, this request performs network I/O and does not use the managed upload queue. Avoid sending it while holding database locks. Return `ok` or `{error, Reason}`; `undefined` means no observer handled the request.

`#filestore_request{}` properties (defined in `zotonic_file.hrl`):

- `action`: `upload`, `download`, or `delete`.
- `remote`: backend-relative path, resolved through `#filestore_credentials_lookup{}`.
- `local`: local source for upload or destination for download; unused for deletion.
- `mime`: optional upload MIME type, guessed from the local file when omitted.
- `handler_pid`: reserved field; the standard handler ignores it and returns the result synchronously. It does not send a completion message to this PID.

The standard handler rejects uploads and deletions in read-only mode. Direct requests do not establish managed media references or apply managed GC retention. See <a href="/id/doc_module_mod_filestore" class="doc-reference doc-reference-module"><code>module#mod_filestore</code></a> for backend configuration.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/3139?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/3139?language=en>)
