Class · inherits Instance
File
An asset loaded from a file on disk.
About File
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.
Properties 1
Size
: int64PluginHiddenReadOnlyNotReplicatedThe size of the file on disk, in bytes.The file size (in bytes) of the local file associated with this
File.
Methods 2
GetTemporaryId
() → ContentIdPluginGets arbxtemp://asset ID for thisFile.This function is used to retrieve a temporary asset ID associated with the
File. The ID can be used likerbxassetid://, for example it can be assigned to theImageproperty of anImageLabel.Throws an error if the file does not exist on disk.
File also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.