Skip to content

FS.UploadFile

boxgaming edited this page Sep 25, 2023 · 2 revisions

Upload a file to the virtual file system.

Syntax

FS.UploadFile destPath$[, filter$][, callbackMethod]

Parameters

  • The destPath$ parameter indicates the directory in the virtual filesystem to which the uploaded file should be saved.
  • The optional filter$ parameter specifies the file types which should be allowed for upload. This is a comma separated list of file extensions and or content types. If not specified, all file types are allowed.
  • The optional callbackMethod defines the sub or function which should be called on completion of the file upload.

Examples

Example 1: Upload a file to the current directory. Only allow image files and PDFs.

Import FS From "lib/io/fs.bas"

Print "Starting upload..."
FS.UploadFile , ".pdf, image/*", sub_OnUpload

Sub OnUpload (fullpath As String)
    Print "File upload complete: "; fullpath
End Sub

See Also

FS.DownloadFile
FS.ListDirectory

Clone this wiki locally