fileExportWeb

Category: File IO (Web target only)

Syntax:

fileExportWeb:Int(filepath:String)


Parameters

Returns

1 if the download started, 0 if the web file store has no such file.



Summary

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.



Example
; Save, then give the player a copy
Local f:Int = fileWriteFile("save.txt")
fileWriteLine(f, "level=7")
fileCloseFile(f)
fileExportWeb("save.txt")

See also: fileExportWeb, fileImportWeb, fileImportWebResult


BambooBasic © 2026 Michael Denathorn