paraworld.file.FindFile
Description
依据指定的逻辑地址查找用户文件
Parameters
Required |
Name |
Type |
Description |
required |
sessionKey |
string |
用户凭证。 |
filePath |
int |
需要查找的文件的逻辑地址,可带通配符(?:单个任意字符;*:多个任意字符) |
optional |
ownerUID |
string |
文件所有者的用户ID,若不传此参数,则指当前用户 |
format |
int |
返回的数据格式(0:XML 1:JSON),默认值为0 |
Example Return XML
<msg xmlns="">
<files>
<param index="1">
<id type="double">1</id>
<fileURL type="string">http://192.168.0.221:81/Uploads/UserUpload/2008-5-10/e3679cf2-d903-47b4-a9c0-c948e714c6ea.jpg</fileURL>
<filePath type="string">upload/2008-5-10/test1.jpg</filePath>
<createDate type="datetime">2008-5-10 10:37:18</createDate>
<uid type="string">6ea1ce24-bdf7-4893-a053-eb5fd2a74281</uid>
</param>
<param index="2">
<id type="double">11</id>
<fileURL type="string">http://192.168.0.221:81/Uploads/UserUpload/2008-5-12/4ea5b380-e071-4caf-9f94-c47c660928cd.jpg</fileURL>
<filePath type="string">upload/2008-5-12/test2.jpg</filePath>
<createDate type="datetime">2008-5-12 16:48:17</createDate>
<uid type="string">6ea1ce24-bdf7-4893-a053-eb5fd2a74281</uid>
</param>
<param index="3">
<id type="double">15</id>
<fileURL type="string">http://www.pala5.com/img/test.jpg</fileURL>
<filePath type="string">map/test3.jpg</filePath>
<createDate type="datetime">2008-5-13 11:28:34</createDate>
<uid type="string">6ea1ce24-bdf7-4893-a053-eb5fd2a74281</uid>
</param>
</files>
</msg>
Example Return JSON
{"files":[{"id":"2","fileURL":"http:\/\/localhost:1630\/Uploads\/UserUpload\/2008-12-8\/1e0a5342-83d7-4c12-9973-974b9d1f67c4.jpg",
"filePath":"\/cyf\/test2","createDate":"2008-12-08T18:23:01.937","uid":"28275afd-670c-4d60-84ef-dc8f4e78ca87"}]}
Error Codes
当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。0:无异常 500:未知错误 499:提供的数据不完整 498:非法的访问 497:数据不存在或已被删除 496:未登录 409:文件夹已存在 410:文件已存在
Test Cases
case 1
Input:
{
["sessionKey"]="6ea1ce24-bdf7-4893-a053-eb5fd2a74281",
["filePath"]="*.jpg",
}
Result:
{
["files"]={
[1]={
["id"]=1,
["uid"]="6ea1ce24-bdf7-4893-a053-eb5fd2a74281",
["filePath"]="upload/2008-5-10/test1.jpg",
["fileURL"]="http://192.168.0.221:81/Uploads/UserUpload/2008-5-10/e3679cf2-d903-47b4-a9c0-c948e714c6ea.jpg",
},
[2]={
["id"]=11,
["uid"]="6ea1ce24-bdf7-4893-a053-eb5fd2a74281",
["filePath"]="upload/2008-5-12/test2.jpg",
["fileURL"]="http://192.168.0.221:81/Uploads/UserUpload/2008-5-12/4ea5b380-e071-4caf-9f94-c47c660928cd.jpg",
},
[3]={
["id"]=15,
["uid"]="6ea1ce24-bdf7-4893-a053-eb5fd2a74281",
["filePath"]="map/test3.jpg",
["fileURL"]="http://www.pala5.com/img/test.jpg",
},
},
}
Topic revision: r4 - 2008-12-09
- CaoYF