PhoneGap .wav upload from an iOS device is creating a 0k file on the server

故事扮演 提交于 2019-12-05 16:38:38

I managed to solve this a few days ago. It's about the myPath variable in the question's example. myPath can't be anything other than the tmp folder (the temporary folder phonegap/device creates) So when you try to send a file, you know for sure a copy of that file was made in the tmp folder. So do this just before the ft.upload:

myPath = myPath.replace(myFolderPath, 'tmp');

In my case myFolderPath was 'Documents\media'. The Documents path is where the custom created files are kept on your device.

I hope this saves people from all visited google search pages :)
(This worked for phonegap 3.0.0)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!