Namespace sap.ui.core.util.FileModule: sap/ui/core/util/File
Utility class to handle files
Since: 1.22.0.
Method Summary
sap.ui.core.util.File.save(sData, sFileName, sFileExtension, sMimeType, sCharset)Triggers a download / save action of the given file.
Method Detail
sap.ui.core.util.File.save(sData, sFileName, sFileExtension, sMimeType, sCharset)
Triggers a download / save action of the given file.
There are limitations for this feature in some browsers:
Internet Explorer 8 / 9
Some file extensions on some operating systems are not working due to a bug in IE. Therefore 'txt' will be used as file extension if the problem is occurring.
Safari (OS X / iOS)
A new window/tab will be opened. In OS X the user has to manually save the file (CMD + S), choose "page source" and specify a filename. In iOS the content can be opened in another app (Mail, Notes, ...) or copied to the clipboard. In case the popup blocker prevents this action, an error will be thrown which can be used to notify the user to disable it.
Android Browser
Not supported
Parameters:
{string} | sData | file content |
{string} | sFileName | file name |
{string} | sFileExtension | file extension |
{string} | sMimeType | file mime-type |
{string} | sCharset | file charset |