File

Show Deprecated
Not Creatable
Not Replicated

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 Team Create.

The default Name of a File instance will be the filename on disk, excluding path, including extension.

Summary

Properties

The size of the file on disk, in bytes.

HIDDEN
READ ONLY
NOT REPLICATED

Events

Methods


Reads the contents of the File as a string.


Gets a rbxtemp asset id for this File.

Properties

Size

Hidden
Read Only
Not Replicated

The file size (in bytes) of the local file associated with this File.

Events

Methods

GetBinaryContents

Plugin Security

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.


Returns

A raw binary string representation of the File's contents.

GetTemporaryId

Plugin Security

This function is used to retrieve a temporary asset id associated with this File. This id can be used like an 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.


Returns

The temporary asset id.