Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions skyvault/README.md
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,7 @@ Skyflow.CollectElementInput(
| Value | Meaning |
| --- | --- |
| `FILE_INPUT` | A single file. The per-file size cap is fixed at 32 MB by the server. |
| `MULTI_FILE_INPUT` | Multiple files, up to `maxFileCount` (default 4), each up to `maxFileSize`. |
| `MULTI_FILE_INPUT` | Multiple files, up to `maxFileCount` (default 4), each up to `maxFileSize` (default 32 MB). |

**Layout.** There is one native layout — a trigger button that opens the picker, the selected files listed below with a per-file remove (✕), and an error line. A single element replaces its one file; a multi element appends up to its max. Style the trigger with `inputStyles`, the label with `labelStyles` and the error line with `errorTextStyles`, as on a text field. Apps that want their own trigger call `openPicker()` (see Step 3).

Expand Down Expand Up @@ -2306,7 +2306,7 @@ Skyflow.CollectElementOptions(
blockEmptyFiles: Boolean, // reject a 0-byte file (default false)
preserveFileName: Boolean, // true (default) keeps the original name (rejected if it has characters outside A-Za-z0-9 ! - _ . * ( )); false sends a generated UUID name (keeps PII in the name out of the vault)
returnFileMetadata: Boolean, // ask the server to return fileName / fileSize / fileType on success (default false)
maxFileSize: Long, // per-file byte cap — MULTI_FILE_INPUT only (single is fixed at 32 MB)
maxFileSize: Long, // per-file byte cap — MULTI_FILE_INPUT only (default 32 MB; single is fixed at 32 MB)
maxFileCount: Int, // max files for one MULTI_FILE_INPUT upload (default 4)
sources: Array<Skyflow.FileSource> // which pickers to offer (default [FILES, PHOTOS])
)
Expand All @@ -2316,6 +2316,8 @@ With `preserveFileName = true` (the default) the original name is uploaded, so i

`allowedFileType` accepts file extensions (`".pdf"`), exact MIME types (`"application/pdf"`) and MIME wildcards (`"image/*"`), matched case-insensitively. Extension entries match the file's extension; MIME and wildcard entries match its resolved content type.

The SDK always rejects `.zip`, `.exe`, `.rar`, `.deb`, and `.apk` files, even when `allowedFileType` lists them or is `null`.

**`sources` — `Skyflow.FileSource`**

When more than one source is enabled the element shows a source chooser; with one source the picker opens directly. None of these require a runtime storage permission.
Expand Down Expand Up @@ -2400,6 +2402,16 @@ The response keeps the **input order** of the files. Outcomes:
| Every file failed | `onFailure` | `{ "errorResponse": [ ... ] }` |
| Some succeeded, some failed | `onFailure` | `{ "fileUploadResponse": [ ... ], "errorResponse": [ ... ] }` |

Each success entry carries the `skyflow_id` of the record the file was uploaded to. With `returnFileMetadata = true`, it also carries the `fileMetadata` object the server returns:

```json
{
"fileUploadResponse": [
{ "skyflow_id": "<SKYFLOW_ID>", "fileMetadata": { ... } }
]
}
```

Each error entry carries its `fileName`, `code` and `description`.

### End to end example of collecting files with Skyflow Elements
Expand Down
Loading