Dumping Data form device to server using Wi-Fi

Discussion in 'Questions (Windows Mobile)' started by mozaharul, Nov 17, 2008.

  1. mozaharul

    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,
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    See this demo for an example of copying files using wifi connection.
    http://www.basic4ppc.com/files/FileTransfer.zip

    You can use this code (on the server side) to find its IP:
    Code:
    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:
    Code:
    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.
     
  3. mozaharul

    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,
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Change this line:
    Code:
    name = binary1.ReadString
    to:
    Code:
    PathOnDesktop = "d:\folder"
    name = PathOnDesktop & 
    "\" & binary1.ReadString
     
  5. mozaharul

    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,
     
  6. mozaharul

    mozaharul Active Member Licensed User

    Please help.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    What do you mean with "the application on the server has to be reinitialized after each transfer from a device" ?
     
  8. mozaharul

    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,
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    The FileTransfer supports a single connection between a device and a desktop.
    This example supports more than one device: http://www.basic4ppc.com/files/ChitChat.zip
    Basically you need to create a Client object for each device.
     
  10. mozaharul

    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,
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice