paraworld.map.UploadFile

Description

上传文件

Parameters

Required Name Type Description
required sessionKey string 用户凭证。上传文件时必须登录
file string 文件数据二进制的base64编码
optional isPhoto boolean 是否是头像图片,如果是,则会生成一个原图(原图最大宽度若大于256,则会适度缩小)和一个小图,默认值为false
extension string 文件的后缀名,如(.jpg .txt 等,若未提供,则从参数filePath中获取,若extension和filepPath都没有值,则没有后缀名)
filePath string 逻辑路径。若未指定,则会默认为 “upload/[当前日期]/[随机文件名][后缀名]”
overwrite int 若指定的目录中已存在同名的文件,是否覆盖它(即删除旧文件,保存新文件),0:否,1:是。如果为0,当指定目录中已存在同名的文件时,会返回错误码:410

Example Return XML

<msg xmlns="">
        <fileSrc32 type="string">4279738660</fileSrc32>
        <fileURL type="string">http://map.pala5.com/Uploads/UserUpload/2008-5-7/a373295b-aecc-47d4-bc59-50ba00289602.jpg</fileURL>
</msg>

Error Codes

当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。0:无异常 500:未知错误 499:提供的数据不完整 498:非法的访问 497:数据不存在或已被删除 496:未登录

Test Cases

case 1

Input:

{

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

        ["file"]="R0lGODlhBwAJAIABAAAzzP///yH5BAEAAAEALAAAAAAHAAkAAAIMjI+Am9yhoDRRVnoKADs=",

        ["extension"]=".jpg",

        ["sessionKey"]="fae5feb1-9d4f-4a78-843a-1710992d4e00",

}

Result:

{

        ["fileSrc32"]="4279738660",

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

}
Topic revision: r4 - 2008-05-10 - CaoYF
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback