Put files in folders, nest folders inside each other, and browse them like a drive in the dashboard or through the API.
A file is in one folder, or in none. Files that are in no folder are at the top level, which is where every file uploaded before folders existed still is. Folders can hold files and other folders, up to 20 levels deep, and an app can have up to 10,000 of them.
Folders only organise files. A folder is never part of a file's URL, so renaming or moving a folder, or moving a file to another folder, never changes a link. Keep storing the file's ID (or a label) as you do today.
Folder names are 1 to 255 characters, can contain spaces, and cannot contain
/\/Products/ShoesThe Files page of each app shows the folders at the top of the list. Open one to see what is inside, with breadcrumbs back up. From there you can:
A file's own page shows its folder under Settings, with a Move button.
The folder endpoints need your private key, like the rest of the management API. The Node, Ruby, Python and PHP libraries have a method for each.
// mkdir -p: makes any folder on the path that is missing
const shoes = await fileboy.createFolder({ path: "/Products/Shoes" })
await fileboy.uploadFileFromPath("./red.png", { folderPath: "/Products/Shoes" })
const page = await fileboy.listFiles({ folderId: shoes.id }) // or { folderPath: "/Products", recursive: true }
await fileboy.moveFiles([file.id], { folderId: shoes.id }) // { folderId: null } is the top level
await fileboy.updateFolder(shoes.id, { name: "Trainers" }) // links to the files don't change
await fileboy.destroyFolder(shoes.id, { contents: "moveToParent" })shoes = fileboy.create_folder(path: "/Products/Shoes")
fileboy.upload_file("red.png", folder_path: "/Products/Shoes")
page = fileboy.list_files(folder_id: shoes.id)
fileboy.move_files([file.id], folder_id: shoes.id)
fileboy.update_folder(shoes.id, name: "Trainers")
fileboy.delete_folder(shoes.id, contents: "moveToParent")shoes = client.create_folder(path="/Products/Shoes")
client.upload_file("red.png", folder_path="/Products/Shoes")
page = client.list_files(folder_id=shoes.id)
client.move_files([file.id], shoes.id)
client.update_folder(shoes.id, name="Trainers")
client.delete_folder(shoes.id, contents="moveToParent")$shoes = $fileboy->createFolder(path: '/Products/Shoes');
$fileboy->uploadFile('red.png', folderPath: '/Products/Shoes');
$page = $fileboy->listFiles(['folderId' => $shoes->id]);
$fileboy->moveFiles([$file->id], $shoes->id);
$fileboy->updateFolder($shoes->id, ['name' => 'Trainers']);
$fileboy->deleteFolder($shoes->id, 'moveToParent');curl -X POST https://api.fileboy.io/folders \
-H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" \
-d '{"path":"/Products/Shoes"}'
curl -G https://api.fileboy.io/files -H "Authorization: token YOUR_SIGNED_TOKEN" \
--data-urlencode folderPath=/Products/ShoesCreate a folder with a
nameparentIdpathSend
folderIdfolderPathnamemetadatafolderIdfolderPathAn upload signed with your private key creates any folders on
folderPath404 folder_not_found1 2 3 4 5 6 7 8import { MultiFileUploader } from "@cd2/fileboy-react" <MultiFileUploader folderPath="/uploads/avatars" onFilesUploaded={files => save(files)} />
1<input type="hidden" data-fileboy="folderPath=/uploads/avatars" name="avatar" />
GET /filesfolderIdrootfolderPathrecursive=truemimemetadataGET /foldersparentId=rootpathparentIdGET /folders/:idancestorsDELETE /folders/:idcontentsrefuse409 folder_not_emptymoveToParentdeletefile.deletedDeleting a file on its own just takes it out of its folder. The folder stays.