File

Hiển Thị Bản Đã Lỗi Thời

*Nội dung này sẽ sớm có sẵn bằng ngôn ngữ bạn chọn.

Không Thể Tạo
Không Sao Chép

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.

Tóm Tắt

Thuộc Tính

  • Ẩn
    Chỉ Đọc
    Không Sao Chép
    Đọc Song Song

    The size of the file on disk, in bytes.

Phương Pháp

Thuộc Tính

Size

Ẩn
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Bảo Mật Plugin

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

Phương Pháp

GetBinaryContents

Bảo Mật Plugin

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.


Lợi Nhuận

A raw binary string representation of the File contents.

GetTemporaryId

ContentId
Bảo Mật Plugin

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.


Lợi Nhuận

ContentId

The temporary asset id.

Sự Kiện