I took your RestTester project and am using it as an example. I have in my app an auto updater, and Wass using HttpSocket. Then it started acting up and was told by @Tim Parnell That I should move to the new frame work as newer servers may not work at all with the classic. I took you Tester and put the url of the file that updates my app and it downloaded it perfectly.
So I started changing things and the line DLHttp.Send(“Get”, mDownloadURL.ToText, downloadFile) is giving me the compile error: “There is more than one item with this name and it’s not clear to which it refers” (I hate that error!)
DLHttp is a Xojo.Net.HTTPSocket, draged on form.
mDownload is a string
download file is a FolderItem
Moving along however I got the Dreaded “There is more than one item with this name and it’s not clear to which this refers”
Dim downloadFileName As String
If Not mUseActualFilename Then
#If TargetMacOS Then
downloadFileName = "MemberTree.pkg.dmg"
downloadFileName = "Setup.exe"
// Use the actual filename from the XML
Dim file() As String
file = mDownloadURL.Split("/")
downloadFileName = file(file.Ubound)
Dim downloadFile As FolderItem
downloadFile = mDownloadLocation.Child(downloadFileName)
Dim newFile As New Xojo.IO.FolderItem(downloadFile.NativePath.ToText)
'MsgBox ("URL:" + mDownloadURL + " Downloadfile: " + downloadFile.AbsolutePath)
'DownloadSocket.Yield = False
DownloadSocket.Send("GET", mDownloadURL, newFile) <<<<<<<<<<<<<<<<<<<<<<Error here
Me.ActionButtonEnabled = False
DownloadSocket is a Xojo.Net.HTTPSocket
Is there a way to convert an xojo.IO.Folderitem Back to a classic folderitem?
From the RecievedFIle event I call this:
LaunchFile(installer As FolderItem)
Soft Declare Function ShellExecuteA Lib "Shell32" (hwnd As Integer, operation As CString, _
file As CString, params As CString, directory As CString, show As Integer) As Integer
Soft Declare Function ShellExecuteW Lib "Shell32" (hwnd As Integer, operation As WString, _
file As WString, params As WString, directory As WString, show As Integer) As Integer
Dim params As String
params = ""
Dim intReturnCode as Integer = 0
If System.IsFunctionAvailable("ShellExecuteW", "Shell32") Then
intReturnCode = ShellExecuteW(0, "runas", installer.AbsolutePath, params, "", 1)
intReturnCode = ShellExecuteA(0, "runas", installer.AbsolutePath, params, "", 1)
If intReturnCode = 5 Then
Dim lfile as FolderItem
installer.Launch 'Launch dmg, which mounts the disk image
lfile = GetFolderItem("MemberTree:MemberTree.mpkg:", 0)
lfile.Launch 'launch the actual pkg file
For number 1 is mDownloadURLText or String? It needs to be Text for the new socket.
For number 2 you would do the same process in reverse. Xojo.IO.FolderItem.Path as Text, convert Text to String, use the path string as a NativePath to construct a classic framework FolderItem.