File
An asset loaded from a file on disk.
Memory category | Instances |
---|
Member index 3
Removed member index 3
History | Member | |
---|---|---|
492 | GetFileContentsBinary(): string |
Description
An object that represents an asset loaded from a file on a local disk. Files
generate a temporary asset ID in the form rbxtemp://
which can be used in
Studio without uploading the asset, but will be destroyed when the
File is destroyed or when the Studio session ends. Temporary asset IDs
are not shared across collaborative
sessions.
The default Name of a File instance will be the filename on disk, excluding the path but including the extension.
History 21
- 645 Change ReturnType of GetTemporaryId from Content to ContentId
- 553 Change Default of from to
- 492 Remove GetFileContentsBinary
- 492 Remove
- 492 Remove
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 462 Change ThreadSafety of GetTemporaryId from to Unsafe
- 462 Change ThreadSafety of GetFileContentsBinary from to Unsafe
- 462 Change ThreadSafety of GetBinaryContents from to Unsafe
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 372 Add GetTemporaryId
- 372 Add GetFileContentsBinary
- 372 Add GetBinaryContents
- 372 Add
- 372 Add
- 372 Add
- 372 Add File
Members 3
GetBinaryContents
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
This function is used to read the contents of the File as a raw binary string. This allows the file to be uploaded to web endpoints, or to be processed by plugins.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetBinaryContents from to Unsafe
- 372 Add GetBinaryContents
GetTemporaryId
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
ContentId |
This function is used to retrieve a temporary asset ID associated with the
File. The ID can be used like rbxassetid://
, for example it can
be assigned to the Image property of an
ImageLabel.
Throws an error if the file does not exist on disk.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 645 Change ReturnType of GetTemporaryId from Content to ContentId
- 462 Change ThreadSafety of GetTemporaryId from to Unsafe
- 372 Add GetTemporaryId
Removed members 3
GetFileContentsBinary
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 492 Remove GetFileContentsBinary
- 462 Change ThreadSafety of GetFileContentsBinary from to Unsafe
- 372 Add GetFileContentsBinary