I have been running two systems, transferring files from B4A to B4J, with the same code for over a year without any issues. I have just updated to B4A 10.2 from 9.8 (reluctantly) to solve another issue and now this process is not working anymore.
The code is basically the tutorial example '
The problem seems to be that the PostFile is doing a GET request not a POST. Has something changed?
Thanks
The code is basically the tutorial example '
' and if I run that as is then I get the same issue as well.[Server] Upload files from your B4A app to your B4J server over the internet
The problem seems to be that the PostFile is doing a GET request not a POST. Has something changed?
Thanks
PostFile does a GET not POST:
B4A device code -
Dim j As HttpJob
j.Initialize("fd", "AudioRecord")
Dim urlstr As String =$"${Main.MyWeb}/qldau?type=file&name=${mFileName}"$
Log($"Send URL = ${urlstr}"$)
j.PostFile(urlstr,"/storage/emulated/0/Download/", mFileName)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log("result success ")
Main.GV.Put("okreply","OK")
CallSubDelayed(Main,"audio_sent")
End If
j.Release
Stopped = True
B4J - server code
Sub Handle(req As ServletRequest, resp As ServletResponse)
Main.filesFolder=File.Combine(File.DirApp, "www/audio")
If req.Method <> "POST" Then
resp.SendError(500, "method not supported.")
Return
End If
Log(req.Method)