I need to enumerate the contents of an MTP android device and transfer files from the device to a Windows PC.
Following the guide found here Transferring Content from a Device to a PC I attempted to transfer a simple text document to a specified directory. However, the output file is always empty, even when the returned value states that X number of bytes have been written.
I created an SSCCE using only the recommended Windows API calls to easily reproduce the issue. I used the API documentation and the official sample project for reference.
To test, I have an android phone connected via MTP with a folder on the root called testFolder
and inside there is a file testfile.txt
with the text hello world
. Upon running this application, the output states that 11 bytes have been written however the file is empty. Please try it yourself?
I can't seem to understand why the file is always empty. Any ideas?
Thanks for your time.