1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-05-12 08:00:12 +00:00
2 FS.UploadFile
boxgaming edited this page 2023-09-25 14:06:59 -05:00

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