Upload file

Upload file,Need SID, safekey, timeStamp, folder ID, uploaded file (binary stream mode). Returns the file ID obtained after uploading.

URL

https://api.eeo.cn/partner/api/cloud.api.php?action=uploadFile

HTTP Request Methods

  • POST

Coding format

  • UTF-8

Request parameters

key Required More Restrictions Instructions Description
SID Yes Null School ID It is available through the eeo.cn application
safeKey Yes Fixed 32-bit all lowercase characters School authentication security key safeKey=MD5(SECRET+timeStamp)
timeStamp Yes Null imestamp used by safeKey Unix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970
folderId Yes Null folder ID Null
Filedata Yes Binary stream Uploaded file The maximum file upload is 100mb, exceeding the upload failure

Response data

key Type Sample value meaning
data string 123456 Upload the obtained file ID
error_info object Return message object
└ errno number 1 The error code
└ error string "Normal execution" Error list

Sample

  • HTTP request
POST /partner/api/cloud.api.php?action=uploadFile HTTP/1.1
Host: www.eeo.cn
Content-Type: multipart/form-data
Cache-Control: no-cache

SID=2339736&safeKey=479aeb917dfb34ff1bf6660a1a5f016c&timeStamp=1493798334&Filedata=@~/file.txt
  • Shell cURL analog request instruction
curl  -F "SID=1234567" \
      -F "safeKey=0f7781b3033527a8cc2b1abbf45a5fd2" \
      -F "timeStamp=1484719085" \
      -F "folderId=123456" \
      -F "Filedata=@~/file.txt" \
      "https://api.eeo.cn/partner/api/cloud.api.php?action=uploadFile"

Response sample(The normal return json packet example)

{
  "data": "123456",
  "error_info": {
    "errno": 1,
    "error": "程序正常执行"
  }
}

Error code instruction

Error code instruction
1 expression successful execution.
100 expression parameter not all or error.
102 expression dont have permissions(Security verification failed).
104 expression operation failure.
193 expression folder does not exist.
194 expression the folder does not belong to this organization(Have the right to operate).
195 expression please select the file you want to upload.
196 expression the folder has no operation privileges.
197 expression failed to upload file.
211 expression file size exceeds limit.

results matching ""

    No results matching ""