roblox
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

  • HiddenThis property is not shown in the object browser and properties window.
  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.
This class member is missing documentation. Create or add to its subpage at Class:File/Size.
  • Category: Data.
  • Read security: PluginSecurity.
  • Write security: PluginSecurity.
  • Serialization: cannot load or save.
  • Thread safety: read safe

Methods

GetBinaryContents(): string

This class member is missing documentation. Create or add to its subpage at Class:File/GetBinaryContents.
  • 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 roblox
local 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

External links