File: FileLoader.md | Updated: 11/15/2025
A low level class for loading resources with the Fetch API, used internally by most loaders. It can also be used directly to load any file type that does not have a loader.
This loader supports caching. If you want to use it, add THREE.Cache.enabled = true; once to your application.
const loader = new THREE.FileLoader();
const data = await loader.loadAsync( 'example.txt' );
Constructs a new file loader.
manager | The loading manager.
---|---
The expected mime type. Valid values can be found here
The expected response type.
Default is ''.
Aborts ongoing fetch requests.
Overrides: Loader#abort
Returns: A reference to this instance.
Starts loading from the given URL and pass the loaded response to the onLoad() callback.
url | The path/URL of the file to be loaded. This can also be a data URI.
---|---
onLoad | Executed when the loading process has been finished.
onProgress | Executed while the loading is in progress.
onError | Executed when errors occur.
Overrides: Loader#load
Returns: The cached resource if available.
Sets the expected mime type of the loaded file.
value | The mime type.
---|---
Returns: A reference to this file loader.
Sets the expected response type.
value | The response type.
---|---
Returns: A reference to this file loader.