paraworld.file.GetFile

Description

依据文件ID或文件逻辑地址取得一个用户文件的数据

Parameters

Required Name Type Description
required sessionKey string 用户凭证。
optional fileID int 文件ID,filePath和fileID中必须有一个有值,若fileID有值,则忽略filePath
filePath string 文件的逻辑地址,filePath和fileID中必须有一个有值,若fileID有值,则忽略filePath
ownerUID string 文件所有者的用户ID,若不传此参数,则指当前用户
format int 返回的数据格式(0:XML 1:JSON),默认值为0

Example Return XML

<msg xmlns="">
        <id type="int">3</isSuccess>
        <fileURL>http://192.168.0.221:81/Uploads/UserUpload/2008-5-7/a373295b-aecc-47d4-bc59-50ba00289602.jpg</fileURL>
        <filePath>map/map1.jpg</filePath>
        <createDate>2008-5-10 10:37:18</createDate>
        <uid>6ea1ce24-bdf7-4893-a053-eb5fd2a74281</uid>
</msg>

Example Return JSON

{"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:

{

        ["filePath"]="map/map1.jpg",

        ["sessionKey"]="dec79cec-a151-476f-954f-027ef8ddac2a",

}

Result:

{

        ["id"]=3,

        ["fileURL"]="http://192.168.0.221:81/Uploads/UserUpload/2008-5-7/a373295b-aecc-47d4-bc59-50ba00289602.jpg",

        ["filePath"]="map/map1.jpg",

        ["createDate"]="2008-5-10 10:37:18",

        ["uid"]="6ea1ce24-bdf7-4893-a053-eb5fd2a74281"

}
Topic revision: r6 - 2008-12-09 - CaoYF
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback