File Storeage Using Kinvey Rest api

╄→гoц情女王★ 提交于 2019-12-11 04:21:53

问题


I try to upload image using KINVEY REST api (http://devcenter.kinvey.com/rest/guides/files#Uploading)

but i failed to upload file in file storage.

please tell me how to send image file-name/file-data in get/put request and which header should i use.

also refer any link which help me.

thanks in advance.


回答1:


I'm an engineer at Kinvey. To use the REST API, you need to first get an API URL to upload by making a GET request to:

/blob/:appKey/upload-loc/:fileName

That will return a response with the following object:

{ "URI" : <externalLocation> }

Exctract response.body.URI, and perform a PUT request to that URI. Set the content-length header, and pass your binary file as the request.body.

A couple of notes about file upload:

  • The URI retrieved by upload-loc is only valid for 30 seconds
  • The library only supports files < 64 MB in size.


来源:https://stackoverflow.com/questions/16655648/file-storeage-using-kinvey-rest-api

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