Dumping Data form device to server using Wi-Fi

mozaharul

Active Member
Licensed User
Hi,

Want to just dump database from the device in a folder on the server using Wi-Fi. How could it be done ?


regards,
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
See this demo for an example of copying files using wifi connection.
http://www.b4x.com/files/FileTransfer.zip

You can use this code (on the server side) to find its IP:
B4X:
    Server.New1(50000)
    Client.New1
    IP() = Client.GetIP(Server.HostName)
    For i = 0 To ArrayLen(IP()) - 1
        Msgbox(IP(i))
    Next
Where IP() is a global array declared as:
B4X:
Dim IP(0)

I find it easier especially during development to just write the IP address in Client.Connect instead of using Client.Connect(Client.GetIP (...)) which may fail if the device can't resolve the server name.
 

mozaharul

Active Member
Licensed User
Hi Erel,

I tried the example, using wi-fi a file can be transferred from the device to a desktop in the current application path. How to change to a defined path in the desktop like (D:\folder) ?

best regards,
 

mozaharul

Active Member
Licensed User
Hi Erel,

Thanks for help. Another issue, the application on the server has to be reinitialized after each transfer from a device. Is there any other way (could be developed in Basic4ppc ) but to use a web utility on the server that would support multiple concurrent session from devices ? Please comments.


best regards,
 

mozaharul

Active Member
Licensed User
Once the data has been transferred from a device to the server, then tried to send data from 2nd device, the device could connect to the server but data was not sent to the server. Although on the 2nd device it was shown the data had been sent to the server.
I closed the application on the server as well on the 2nd device and run it again (reinitialized) then the 2nd device data was sent to the server, but again I couldn't send data from the 3rd device to the server.

Hope, I could explain the problem .


best regards,
 

mozaharul

Active Member
Licensed User
I tried to create client object for each device, but its all the same as before. I attached the code, please have look.


best regards,
 

Attachments

  • FileTransfer_wi-fi_R&D.sbp
    4.9 KB · Views: 165
Top