嗨我工作的android應用程序bayfiles,您可以在其中查看,刪除和上傳文件。他們有一個使用Json API將文件上傳到服務器的API,但是我可以弄清楚如何做到這一點。什麼文檔說:使用json API上傳文件android
/file/uploadUrl
{ error: "", uploadUrl: , progressUrl: }
The returned URL is valid for a limited amount of time, you need to request a new one for each upload. Issue a POST request to the "uploadUrl" to upload the file. You can poll "progressUrl" to fetch the current progress. The POST request needs to be multipart/form-data encoded and contain a "file" field. cUrl example: curl -F "[email protected]" " http://s6.baycdn.com/upload/93b37e57/4e691e0c/6/0?X-Progress-ID=4e639fcd34CC2F73796CF81679C605643A8F99CF " Note: in order to upload a file to your account, you need to first log in using /account/login and then append ?session=XYZ to /file/uploadUrl On success, the "uploadUrl" will respond with an object: { error: "", fileId: , size: , sha1: , infoToken: , deleteToken: , linksUrl: , downloadUrl: , deleteUrl: , }
我不能理解如何使用android做到這一點。任何幫助深表感謝!
謝謝!這是正確的回答:) –