Copies a file from the web file store to the user's computer, as a browser download (usually into the Downloads folder).
Takes filepath (the name of a file in the web file store).
Returns: 1 if the download started, 0 if the web file store has no such file.
File IO
Parameters & Returns
Parameters
filepathString
Returns
Int
Quick Summary
Copies a file from the web file store to the user's computer, as a browser download (usually into the Downloads folder).
Takes filepath (the name of a file in the web file store).
Returns: 1 if the download started, 0 if the web file store has no such file.
Technical Exegesis...
Copies a file from the web file store to the user's computer, as a browser download (usually into the Downloads folder). On the web, files your program writes (fileWriteFile and so on) are kept in the browser's local storage, not on disk; this hands one of them to the user, for example a save game to keep or share. The download is named after the last part of filepath.
Web target only: on the desktop, programs read and write real files, so they don't need it. See Building for the Web (File System).
Copies a file from the web file store to the user's computer, as a browser download (usually into the Downloads folder). On the web, files your program writes (fileWriteFile and so on) are kept in the browser's local storage, not on disk; this hands one of them to the user, for example a save game to keep or share. The download is named after the last part of filepath.
Web target only: on the desktop, programs read and write real files, so they don't need it. See Building for the Web (File System). GUI programs using BGI can use bgiExportFileWeb / bgiImportFileWeb instead, which answer with a BGI event.
Returns: 1 if the download started, 0 if the web file store has no such file.
Example
Example.bam
; Save, then give the player a copyLocal f:Int = fileWriteFile("save.txt")
fileWriteLine(f, "level=7")
fileCloseFile(f)
fileExportWeb("save.txt")