...
' start block
Else
Dim filePart As Part = data.Get("editor")
If filePart.IsInitialized Then
fileName = ABMShared.GetGUID & filePart.SubmittedFilename
tmpFileName = filePart.TempFile
If ABM.HandleUpload(downloadfolder, tmpFileName, fileName) Then
If SubExists(callback, "Page_FileUploaded") Then
CallSubDelayed3(callback, "Page_FileUploaded", fileName, True)
End If
Else
If SubExists(callback, "Page_FileUploaded") Then
CallSubDelayed3(callback, "Page_FileUploaded", fileName, False)
End If
End If
resp.Write($"../EditorImages/${fileName}"$)
End If
End If
' end block
End If
End If
Catch
' in global
Public DownloadFolder As String
Public DownloadMaxSize As Long = 1024*1024*5
' at the end of Websocket_Connected
DownloadFolder = File.Combine(File.DirApp, "\www\" & AppName & "\EditorImages\")
If File.Exists("",DownloadFolder) = False Then
File.MakeDir("", DownloadFolder)
End If
Dim WindowName As String = ABMPageId.Replace(Name, "")
ws.Session.SetAttribute("abmcallback" & WindowName, Me)
ws.Session.SetAttribute("abmdownloadfolder" & WindowName, DownloadFolder)
ws.Session.SetAttribute("abmmaxsize" & WindowName, DownloadMaxSize)
' in Websocket_Disconnected
Try
Dim WindowName As String = ABMPageId.Replace(Name, "")
ws.Session.RemoveAttribute("abmcallback" & WindowName)
ws.Session.RemoveAttribute("abmdownloadfolder" & WindowName)
ws.Session.RemoveAttribute("abmmaxsize" & WindowName)
Catch
Log(LastException.Message)
End Try
Escapes all special characters to their corresponding
entity reference (e.g. {@code <}) at least as required by the
specified encoding. In other words, if a special character does
not have to be escaped for the given encoding, it may not be.
Reference:
http://www.w3.org/TR/html4/sgml/entities.html
input: the (unescaped) input string
encoding: The name of a supported {@link java.nio.charset.Charset charset}
Return type: @return:the escaped string
Escapes all special characters to their corresponding numeric
reference in decimal format (Decimal;).
Reference:
http://www.w3.org/TR/html4/sgml/entities.html
input: the (unescaped) input string
Return type: @return:the escaped string
Escapes all special characters to their corresponding
entity reference (e.g. {@code <}).
Reference:
http://www.w3.org/TR/html4/sgml/entities.html
input: the (unescaped) input string
Return type: @return:the escaped string
Escapes all special characters to their corresponding numeric
reference in hex format (Hex;).
Reference:
http://www.w3.org/TR/html4/sgml/entities.html
input: the (unescaped) input string
Return type: @return:the escaped string
Handles complete character set defined in HTML 4.01 recommendation
and all reference types (decimal, hex, and entity).
Correctly converts the following formats:
&#Entity; - (Example: &) case sensitive
&#Decimal; - (Example: D)
&#xHex; - (Example: å) case insensitive
Reference:
http://www.w3.org/TR/html4/sgml/entities.html
input: the (escaped) input string
Return type: @return:the unescaped string