I am new to Windows Phone developing and I am trying to copy a file from PC to Windows Phone Documents folder. I read and tried what is written in this article Copy files with WPD to Windows Phone C#. The original article is https://dzone.com/articles/creating-apis-for-mobile-iot-apps. Unfortunately I got an error of ArgumentException in the line:
targetStream.Write(buffer, bytesRead, pcbWritten);
I think it's related to the parameter ParentObjectID, when I call the method:
device.TransferContentToDevice(@"H:\temp\QuestPhone\Pesquisas.db",@"G:\Documents");
I tried to replace "G:\Documents" by "Windows Phone:\Documents", and "Phone:\Documents" and "Windows Phone:\Phone\Documents" but without success.
So, how can I specify the "logical drive" where my Windows Phone device is connected to?
After some time I got a solution. The correct ParentObjectID is @"o1". "o1" is the ID of documents folder on the device.