fileImportWeb

Category: File IO (Web target only)

Syntax:

fileImportWeb:Int(filter:String)


Parameters

Returns

1 if the file picker opened, 0 if an import is already waiting for the user.



Summary

Lets the user pick a file on their computer and copies it into the web file store under its own name, so fileReadFile and the other file functions can read it. A browser can't wait for the user, so this returns at once: check fileImportWebResult each frame to find out what happened. Call it when the user clicks or presses a key (a button, a menu item): browsers only open a file picker straight after one.

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
If igiButton("Load...") Then fileImportWeb(".sav")

; every frame:
Local name:String = fileImportWebResult()
If name <> "" And name <> "*cancelled*" Then LoadGame(name)

See also: fileExportWeb, fileImportWeb, fileImportWebResult


BambooBasic © 2026 Michael Denathorn