mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-05-12 08:00:12 +00:00
Page:
FS.UploadFile
Pages
Adding Support for a New Keyword
Console.Echo
Console.Log
Console.LogLevel
Dom.Add
Dom.Alert
Dom.Confirm
Dom.Container
Dom.Create
Dom.Event
Dom.Get
Dom.GetImage
Dom.Prompt
Dom.Remove
Export
FS.DownloadFile
FS.ListDirectory
FS.UploadFile
G2D.Bezier
G2D.Curve
G2D.Ellipse
G2D.FillCircle
G2D.FillEllipse
G2D.FillRoundRect
G2D.FillTriangle
G2D.InvertRect
G2D.LineCap
G2D.LineDash
G2D.LineDashOff
G2D.LineWidth
G2D.RotoZoom
G2D.RoundRect
G2D.SaveImage
G2D.Shadow
G2D.ShadowOff
G2D.Triangle
Home
Import
QBasic Language Support
Roadmap
Samples
Storage.Clear
Storage.Get
Storage.Key
Storage.Length
Storage.Remove
Storage.Set
Supported Keywords
Unsupported Keywords
2
FS.UploadFile
boxgaming edited this page 2023-09-25 14:06:59 -05:00
Table of Contents
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