File Structure
Hublink uses file name and file size to determine if a file needs to be uploaded (or re-uploaded) to the cloud. Some common issues to be aware of:
- Overwriting files byte-for-byte: If a file is overwritten byte-for-byte, the file size will not change, and Hublink will not upload the file again.
- Large files: If a file is large, the upload time will be proportional to the file size, which may cause delays in data transfer and impacts battery life.
Files in Amazon S3 are organized according to the upload_path and optional append_path
settings. The resulting file structure is:
bucket_name/├── upload_path/ # From hublink.upload_path│ ├── append_path/ # From hublink.append_path reference│ │ └── filename.csv # Actual files│ └── another_path/└── ...Path Construction
Section titled “Path Construction”The append_path field supports multiple nested JSON values separated by forward slashes. The path
is constructed as follows:
- Starts with
upload_path - Appends each value specified in
append_pathif it exists and is not empty - Skips any missing or empty values
- Sanitizes the path to ensure it’s valid for S3 storage:
- Allows alphanumeric characters (a-z, A-Z, 0-9)
- Allows hyphen (-), underscore (_), plus (+), period (.)
- Removes duplicate slashes
- Removes trailing slashes
Path Construction Examples
Section titled “Path Construction Examples”upload_path: "/FED" with append_path: "subject:id"
bucket/└── FED/ └── mouse001/ └── data.csvupload_path: "/FED" with append_path: "subject:id/experimenter:name"
bucket/└── FED/ └── mouse001/ └── john_doe/ └── data.csv