Global File
The new Global File API is used to access V3 of our Global Files Service. The V3 API brings new features to global files:
- Ability to organize files into sub-directories
- Ability to upload global files from the Client Libraries (by migrating an uploaded User File)
Note that because these files are global to the app, this API has been designed with additional checks (in terms of treeIds, versions, etc.) for concurrency safety.
Important notes:
- V3 files are stored separately from the legacy global files
- This API is not supported by the current Design Portal.
To access the files uploaded into the Custom Config | Files section of the portal, you need to use the legacy S3 Handling service.
There is a new globalFileTree structure added to app-record to hold the tree structure that we will store files in. Note that this structure is separate from the files list itself (which will still be stored in the fileMetadata collection) and of course the cloud storage itself (accomplished via S3, Google Cloud Store, etc). The treeId (aka globalTreeId, folder or file Id) represents the guid for folders or files in the file tree structure.
API Summary
Client File Retrieval APIs
- GetGlobalFileList() - list all global files at the specified
folderPath
- GetFileInfo() - returns information about the specified file, given a
fileId
. - GetFileInfoSimple() - returns information about the specified file, given a
folderPath
+filename
. - GetGlobalCDNUrl() - only required for clients that don't support redirection
System File Retrieval APIs
Accessible via cloud-code and S2S.
- SysCheckFilenameExists - Check if filename exists for provided path and name.
- SysCheckFullpathFilenameExists - Check if filename exists for provided full path name.
- SysGetGlobalFileList - list all global files at the specified
folderPath
- SysGetFileInfo() - returns information about the specified file, given a
fileId
. - SysGetFileInfoSimple() - returns information about the specified file, given a
folderPath
+filename
. - SysGetGlobalCDNUrl - only required for clients that don't support redirection
File Management
- SysMoveToGlobalFile() - migrate a file from User Files to the Global File system
- SysCopyGlobalFile() - copy a file
- SysMoveGlobalFile() - move (or rename) a file
- SysDeleteGlobalFile() - delete a file
- SysDeleteGlobalFiles() - delete the contents of a directory
Folder Management
- SysLookupFolder - lookup a folder given it's path
- SysCreateFolder - create a folder
- SysMoveFolder - move a folder
- SysRenameFolder - rename a folder
- SysDeleteFolder - delete a folder
📄️ CheckFilenameExists
Check if filename exists for provided path and name.
📄️ CheckFullpathFilenameExists
Check if filename exists for provided path and name.
📄️ GetFileInfo
Returns information about the specified file.
📄️ GetFileInfoSimple
Given a path and filename, returns information about the corresponding file.
📄️ GetGlobalCDNUrl
This method was added to support clients (like very old versions of Unity - i.e. circa 2016) that cannot handle HTTP Redirects. This method allows clients to pre-resolve the CDN endpoint for the file to download.
📄️ GetGlobalFileList
Retrieves the list of global files stored at the specified directory location.
📄️ SysCheckFilenameExists
Check if filename exists for provided path and name.
📄️ SysCheckFullpathFilenameExists
Check if filename exists for provided full path name.
📄️ SysCopyGlobalFile
Makes a copy of the specified file.
📄️ SysCreateFolder
Creates a new Global File folder. Returns the updated directory tree and version.
📄️ SysDeleteFolder
Delete the specified folder (and optionally child files and subfolders). Return the updated directory tree.
📄️ SysDeleteGlobalFile
Deletes the specified global file.
📄️ SysDeleteGlobalFiles
Delete all the files in the specified directory. Returns a list of the files that were deleted.
📄️ SysGetFileInfo
Returns information on the specified file.
📄️ SysGetFileInfoSimple
Given a path and filename, returns information on the corresponding file.
📄️ SysGetGlobalCDNUrl
Returns the CDN URL for the specified file.
📄️ SysGetGlobalFileList
Retrieves the list of global files stored at the specified directory location.
📄️ SysLookupFolder
Returns the treeId for the specified folder.
📄️ SysMoveFolder
Move a folder (and its contents). Returns the updated directory tree.
📄️ SysMoveGlobalFile
Move or rename the specified file.
📄️ SysMoveToGlobalFile
Copies the specified User File to the Global File V3 system.
📄️ SysRenameFolder
Rename the specified folder.