---+!! =paraworld.map.UploadFile= <div style="float: right; margin: 5px; width: 250px; color: #4e5155; background-color: #f0eded; border: #ccc 1px solid; padding: 5px"> *Contents* %TOC% </div> ---++ Description 上传文件 ---++ Parameters |*Required*|*Name*|*Type*|*Description*| |<font color="#4682b4">required</font>|sessionKey|%BLUE%string%ENDCOLOR%|用户凭证。上传文件时必须登录| |^|file|%BLUE%string%ENDCOLOR%|文件数据二进制的base64编码| |^|extension|%BLUE%string%ENDCOLOR%|文件的后缀名。如 .jpg .gif .txt 等| |<font color="4682b4">optional</font>|isPhoto|%BLUE%boolean%ENDCOLOR%|是否是头像图片,如果是,则会生成一个原图(原图最大宽度若大于256,则会适度缩小)和一个小图,默认值为false| |^|directoryID|%BLUE%int%ENDCOLOR%|存储该上传文件的文件夹的ID。若没有指定,则默认将文件存储在以当前日期命名的文件夹中。| |^|fileName|%BLUE%string%ENDCOLOR%|文件的名称。默认为随机分配的文件名| |^|overwrite|%BLUE%int%ENDCOLOR%|若指定的目录中已存在同名的文件,是否覆盖它(即删除旧文件,保存新文件),0:否,1:是。如果为0,当指定目录中已存在同名的文件时,会返回错误码:410| ---++ Example Return XML <verbatim> <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> </verbatim> ---++ Error Codes 当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。0:无异常 500:未知错误 499:提供的数据不完整 498:非法的访问 497:数据不存在或已被删除 496:未登录 ---++ Test Cases ---+++!! case 1 Input: <verbatim> { ["fileName"]="TestImg1", ["file"]="R0lGODlhBwAJAIABAAAzzP///yH5BAEAAAEALAAAAAAHAAkAAAIMjI+Am9yhoDRRVnoKADs=", ["extension"]=".jpg", ["sessionKey"]="fae5feb1-9d4f-4a78-843a-1710992d4e00", } </verbatim> _Result_: <verbatim> { ["fileSrc32"]="4279738660", ["fileURL"]="http://192.168.0.221:81/Uploads/UserUpload/2008-5-7/a373295b-aecc-47d4-bc59-50ba00289602.jpg", } </verbatim>
Edit
|
Attach
|
P
rint version
|
H
istory
:
r11
|
r5
<
r4
<
r3
<
r2
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r3 - 2008-05-07
-
CaoYF
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
Edit
Attach
Copyright © 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