There is more than one method with this name

I’m getting a compile error stating that “There is more than one method with this name but this does not match any of the available signatures.”

Dim fileID As String = "4_z642f713eb97d25bb7b340510_f111bf2b54be92c40_d20200911_m230002_c000_v0001074_t0024"
Dim requestURL As String = auth.apiUrl + "/b2api/v2/b2_download_file_by_id" + "?fileId=" + fileID

b2File = new Xojo.IO.FolderItem("pic.jpg")

>> myHTTPSocket1.Send("GET", requestURL, b2File)

Documentation: Xojo.Net.HTTPSocket.Send (method, URL, file)

I’ve had a lot of them. Usually it just means a syntax error (method does not exist…)

Web1 code used in what Xojo version ?

2019r32

What have you declared myHTTPSocket1 as?

Looks like you’re using Xojo.Net.HTTPSocket. In which case you need to convert your requestURL to Text with the ToText() method:

myHTTPSocket1.Send("GET", requestURL.ToText, b2File)

If you’re using 2019r3.2, you probably ought to use URLConnection, though.

.ToText worked. Thank you.

Xojo.Net.HTTPSocket is returning the file (supposedly). The file size saved to disk is 62 bytes. The actual file size is 4.69Mb. I tried URLConnection as you suggested and get the same “There is more than on method…” error at compile time.

Dim fileID As String = "4_z642f713eb97d25bb7b340510_f111bf2b54be92c40_d20200911_m230002_c000_v0001074_t0024"
Dim requestURL As String = auth.apiUrl + "/b2api/v2/b2_download_file_by_id" + "?fileId=" + fileID

Dim f As new Xojo.IO.FolderItem(App.DocumentRoot.ToText)
f = f.Child("pic.jpg")

'myHTTPSocket1.Send("GET", requestURL.ToText, f)
FileDownloader.Send("GET", requestURL, f)

URLConnection takes a FolderItem, not a Xojo.IO.FolderItem so you’ll also have to get the file like this:

Var f As New FolderItem(App.DocumentRoot, FolderItem.PathModes.Native)

What was in your 62 byte file? Odds are it was text of an error message of some kind from the server.

Thanx. I figured out that URLConnection only took a FolderItem. The 62 byte file is nothing. It seems I’m getting a 401 return code.