UpLoadGadget
An open source gadget for SpiderBasic language that provides drag’n’drop file uploads
Install / Use
/learn @falsam/UpLoadGadgetREADME
UpLoadGadget
An open source gadget for SpiderBasic language that provides drag’n’drop file uploads.
This gadget uses the JavaScript dropzone.js
Demo
http://falsam.com/sbtest/uploadgadget.php
Syntax
Result = UploadGadget(Gadget, x, y, Width, Height, Prompt$, Pattern$="", CallBack=#False, MaxFiles=1, MaxFilesSize=2)
Description
Create a Upload gadget. This gadget provides drag’n’drop file uploads.
Events
#DZ_EventType_Add
An element is added on the DropZone.
#DZ_EventType_Progress
A file is being transferred to the server.
#DZ_EventType_Error
An error has just occurred. (Error type of file, file too big, etc...)
#DZ_EventType_Success
Transfer completed.
#DZ_EventType_Maxfilesexceeded
Number of files transferred simultaneously exceeding the allowed limit (MaxFiles).
Installation.
When creating your web application, it is important to enter an application name followed by the .php extension.
Example: yourapp.php
Copy the upload.php script to the installation folder of your web application.
Copy the dropzone.js script to the installation folder of your web application.
Example
IncludeFile "UploadGadget.sbi"
Declare OnUpload(Event.i, FileName.s, Size.i, Message.s)
UseModule DropZone
OpenWindow(0, 0, 0, 440, 250, "Demo", #PB_Window_ScreenCentered)
UploadGadget(0, 20, 20, 400, 200, "Drag your image file to this area", "*.png,*.jpg", @onUpload(), 1, 1)
; UpLoadGadget() events
Procedure OnUpload(Event.i, FileName.s, Size.i, Message.s)
Select Event
Case #DZ_EventType_Add
Debug FileName + " (" + Str(Size) + ") Add"
Case #DZ_EventType_Progress
Debug FileName + " Upload Progress " + Message + "%"
Case #DZ_EventType_Success
Debug FileName + " End of processing"
Case #DZ_EventType_Error
Debug FileName + " Error " + Message
Case #DZ_EventType_Maxfilesexceeded
Debug FileName + " Error " + Message
EndSelect
EndProcedure
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
