Missing API Documentation
This API Class does not have any or complete API documentation. Please add API documentation if possible.
The File class is a non-creatable class that inherits from Instance.
Properties
Size: int64
- Category: Data.
- Read security: PluginSecurity.
- Write security: PluginSecurity.
- Serialization: cannot load or save.
- Thread safety: read safe
Methods
GetBinaryContents(): string
- Security: PluginSecurity.
- Thread safety: unsafe
GetTemporaryId(): ContentId
This function is used to retrieve a temporary asset id associated with the 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.
This example loads a file that the user selected from their file explorer and plays it in robloxlocal file = game:GetService("StudioService"):PromptImportFile({"mp3"})
local sound = Instance.new("Sound")
sound.Parent = game.Workspace
sound.SoundId = file:GetTemporaryId()
sound:Play()
- Security: PluginSecurity.
- Thread safety: unsafe
Removed members
Methods
Properties
External links
- File in the Roblox API Reference