You can suggest a file name in the slug field. However, the Solid
Server may or may not use the suggested slug as the file name.
Recommended: You can specify the media type
of the file in the contentType. If unspecified, the function uses the default type of
application/octet-stream, indicating a binary data file.
The function saves a file into an existing Container. If the
Container does not exist, either:
Create the Container first using [[createContainerAt]], and then
use the function, or
Use [[overwriteFile]] to save the file. [[overwriteFile]] creates
the Containers in the saved file path as needed.
Users who only have Append but not Write access to a Container
can use [[saveFileInContainer]] to save new files to the Container.
That is, [[saveFileInContainer]] is useful in situations where users
can add new files to a Container but not change existing files in
the Container, such as users given access to send notifications to
another's Pod but not to view or delete existing notifications in that Pod.
Users with Write access to the given folder/Container may prefer to
use [[overwriteFile]].
A Promise that resolves to the saved file, if available, or null if the current user does not have Read access to the newly-saved file. It rejects if saving fails.
Saves a file in an existing folder/Container associated with the given URL.
For example:
For additional example, see Read/Write Files.
In the
options
parameter,You can suggest a file name in the
slug
field. However, the Solid Server may or may not use the suggestedslug
as the file name.Recommended: You can specify the media type of the file in the
contentType
. If unspecified, the function uses the default type ofapplication/octet-stream
, indicating a binary data file.The function saves a file into an existing Container. If the Container does not exist, either:
Users who only have
Append
but notWrite
access to a Container can use [[saveFileInContainer]] to save new files to the Container. That is, [[saveFileInContainer]] is useful in situations where users can add new files to a Container but not change existing files in the Container, such as users given access to send notifications to another's Pod but not to view or delete existing notifications in that Pod.Users with
Write
access to the given folder/Container may prefer to use [[overwriteFile]].