paraworld.map.UploadFile

Description

上传文件

Parameters

Required Name Type Description
required sessionKey string 用户凭证。上传文件时必须登录
file string 文件数据二进制的base64编码
extension string 文件的后缀名。如 .jpg .gif .txt 等
optional isPhoto boolean 是否是头像图片,如果是,则会生成一个原图(原图最大宽度若大于256,则会适度缩小)和一个小图,默认值为false
directoryID int 存储该上传文件的文件夹的ID。若没有指定,则默认将文件存储在以当前日期命名的文件夹中。
fileName string 文件的名称。默认为随机分配的文件名
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:

{

        ["fileName"]="TestImg1",

        ["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: r3 - 2008-05-07 - 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