Skip to content
Alban LEROUX edited this page Feb 28, 2012 · 1 revision

API

upload.init

This provided a upload session id. Call this method is required to start a file upload to the server.

See : Upload

require write grant access

Request example

{
	"method"  : "upload.init",
	"request" :
	{
		"name"    : "IMG_5673.JPG",
		"type"    : "image/jpeg",
		"size"    : 11024661,
		"chunks"  : 18
	}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<method>upload.init</method>
	<request>
		<name>IMG_5673.JPG</name>
		<type>image/jpeg</type>
		<size>11024661</size>
		<chunks>18</chunks>
	</request>
</xml>

Response example

{
	"status"   : "valid",
	"response" : { "id" : "up_rla52vlY" }
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<status>valid</status>
	<response>
		<id>up_rla52vlY</id>
	</response>
</xml>

Arguments

  • name : The file name.
  • type : The file MIME type.
  • size : The file size (in Byte).
  • chunks: The number of chunks will be sent.

Return Value

  • id: The upload session id.
Clone this wiki locally