Transfer log files off iPad



  • My iOS app writes logs to the Documents folder of my app bundle. The app is written using the Qt framework. I have a need to programmatically transfer log files from the device to another location as part of the app's initialization.

    I was wondering if anyone else has had similar needs? The logs are shareable and I can manually export them via iTunes or iExplorer, but I need an automated way to do this from within the app. I could write a custom socket transfer routine to do this, but that involves more details such as communicating the original file name, etc. I am hoping for a more turnkey approach I can integrate with my app.

    I appreciate any suggestions


  • Lifetime Qt Champion

    Hi,

    Something's not clear: do you want to transfer that to your user PC or to a central server ?



  • @SGaist I'm not sure why that matters. In no scenario is there a physical connection to the iPad containing the log files I wish to transfer. All of the possible destinations are hosts on the same network, and my IPC is TCP sockets, so I don't think it matters where I want to send it with regards to the solution required, as long as the receiver is prepared to receive the files and there are no network obstacles in the way. As I mentioned, all of the potential recipients are on the same network with no intervening firewalls or such.

    Basically, the iPad app launches and connects to another application running on a Linux host. Once that connection is made, I want the iPad app to send any log files from the previous run, sitting in the Documents folder of the bundle, to this service over the socket. Once that is complete, the iPad app finishes its initialization and starts operation. New log files which will be created and transferred the next time the app is initialized.

    Right now, I am looking at creating a custom message containing the filename in the header with the rest of the log file as the payload. The receiving side will parse the header and save the payload using the transferred filename to recreate the original file. I am just hoping there is a more turn-key solution


  • Lifetime Qt Champion

    AFAIK, there isn't. You can use the fortune client/server as a base to send your file to the server. If your server provides a REST API for the upload then QNAM is your friend. You can post files with it pretty easily. One last thing might be to add zeroconf in the mix so you can make your application discover where to send the data automagically.



  • @SGaist Thanks! I will look into it!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.