/
File.yaml
85 lines (83 loc) · 2.49 KB
/
File.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: File
type: class
category:
memory_category: Instances
summary: |
An asset loaded from a file on disk.
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
`Class.File` is destroyed or when the Studio session ends. Temporary asset IDs
are not shared across [collaborative](../../../projects/collaboration.md)
sessions.
The default `Class.Instance.Name|Name` of a `Class.File` instance will be the
filename on disk, excluding the path but including the extension.
code_samples:
inherits:
- Instance
tags:
- NotCreatable
- NotReplicated
deprecation_message: ''
properties:
- name: File.Size
summary: |
The size of the file on disk, in bytes.
description: |
The file size (in bytes) of the local file associated with this
`Class.File`.
code_samples:
type: int64
tags:
- Hidden
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: PluginSecurity
write: PluginSecurity
thread_safety: ReadSafe
category: Data
serialization:
can_load: false
can_save: false
methods:
- name: File:GetBinaryContents
summary: |
Reads the contents of the `Class.File` as a string.
description: |
This function is used to read the contents of the `Class.File` as a raw
binary string. This allows the file to be uploaded to web endpoints, or to
be processed by plugins.
code_samples:
parameters: []
returns:
- type: string
summary: |
A raw binary string representation of the `Class.File` contents.
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
- name: File:GetTemporaryId
summary: |
Gets a `rbxtemp://` asset ID for this `Class.File`.
description: |
This function is used to retrieve a temporary asset ID associated with the
`Class.File`. The ID can be used like `rbxassetid://`, for example it can
be assigned to the `Class.ImageLabel.Image|Image` property of an
`Class.ImageLabel`.
Throws an error if the file does not exist on disk.
code_samples:
parameters: []
returns:
- type: Content
summary: |
The temporary asset id.
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
events: []
callbacks: []