Search code examples
restfile-storagekinvey

File Storeage Using Kinvey Rest api


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.


Solution

  • 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.