Note: All this taken from the Demo program
1) Add a couple of globals
Public DownloadFolder As String = "/www/" & ABMShared.AppName & "/uploads/"
Public DownloadMaxSize As String = 500*1024
2) Make sure the directory exists as set in #1
3) In a ) WebSocket_Connected where it logs
Log("Websocket first connectoin")
or b) if you use ConnectPage
place the following code before page.Refresh (placement may not be important, I'm just following Demo code)
page.ws.session.SetAttribute("abmcallback", Me)
page.ws.session.SetAttribute("abmdownloadfolder", DownloadFolder)
page.ws.session.SetAttribute("abmmaxsize", DownloadMaxSize)
4) Create an ABMUpload compenent and place it
Sample code:
' create the upload
Dim upload As ABMUpload
upload.Initialize(page, "upload", "Drop Here", "Browse", "")
upl.Content.CellR(0,1).AddComponent(upload)
5) Add you Page_FileUploaded method (to the same page the ABMUpload component is placed):
Sub Page_FileUploaded(FileName As String, success As Boolean)
Log("Page_FileUploaded")
If success Then
Log($"${FileName} has been successflly uploaded"$)
Else
Log($"File ${FileName} not uploaded!"$)
End If
End Sub
6) Enjoy the double call of Page_FileUploaded when the file size is too large
If you are doing more than displaying a failure message, then it could be an issue (since you would duplicate your failure mitigation code). Otherwise you are just posting two notifications per failure.