librelist archives

« back to archive

Upload出错

Upload出错

From:
Uno Young
Date:
2012-05-02 @ 07:17
一个form提交如下数据,

------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
name="name" test ------WebKitFormBoundaryalsBj38a9JGJjeB2
Content-Disposition: form-data; name="category" 170
------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
name="video"; filename="20120301142002166.flv" Content-Type: video/x-flv
------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
name="width" 500 ------WebKitFormBoundaryalsBj38a9JGJjeB2
Content-Disposition: form-data; name="height" 400
------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
name="ajax" 1 ------WebKitFormBoundaryalsBj38a9JGJjeB2--


后台使用req.POST时,只有{multipart='true'},从而导致上传失败

Re: Upload出错

From:
Uno Young
Date:
2012-05-02 @ 07:28
html片段如下:

<div class="pageContent">
    <form id    = "video_editor"
        enctype = "multipart/form-data"
        method  = "post"
        action  = "/admin/video/createInstance/"
        class   = "pageForm required-validate"
        onsubmit= "return iframeCallback(this, navTabAjaxDone)">

        <div class="pageFormContent nowrap" layouth="52">
            <dl>
                <dt>视频标题:</dt>
                <dd><input name="name" /></dd>
            </dl>

            <dl>
                <dt>视频类别:</dt>
                <dd>
                    <select name="category">
                    {%  for i,v in ipairs(categories) do       %}
                            <option value="{{v.id}}"
                            {% if v.name == "未分类" then %}
                                selected="selected"
                            {% end %}  >
                                {{v.name}}
                            </option>
                    {%  end                                    %}
                    </select>
                 </dd>
            </dl>

            <dl>
                <dt>视频:</dt>
                <dd>
                    <input type="file" name="video">
                </dd>
            </dl>
            <dl>
                <dt>宽度:</dt>
                <dd><input name="width" /></dd>
            </dl>
            <dl>
                <dt>高度:</dt>
                <dd><input name="height" /></dd>
            </dl>
</div>


                <div class="formBar">
                    <ul>
                        <li><div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">提交</button>
                            </div>
                        </div> </li>
                        <li><div class="button">
                            <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div></li>
</ul>
            </div>
</form>
</div>


2012/5/2 Uno Young <littlehaker@gmail.com>

> 一个form提交如下数据,
>
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="name" test ------WebKitFormBoundaryalsBj38a9JGJjeB2
> Content-Disposition: form-data; name="category" 170
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="video"; filename="20120301142002166.flv" Content-Type: video/x-flv
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="width" 500 ------WebKitFormBoundaryalsBj38a9JGJjeB2
> Content-Disposition: form-data; name="height" 400
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="ajax" 1 ------WebKitFormBoundaryalsBj38a9JGJjeB2--
>
>
> 后台使用req.POST时,只有{multipart='true'},从而导致上传失败
>

Re: [bamboo] Upload出错

From:
Tang Daogang
Date:
2012-05-02 @ 07:36
firefox下上传的原始POST内容如下:

-----------------------------41184676334 Content-Disposition: form-data;
name="name" bbb -----------------------------41184676334 Content-Disposition:
form-data; name="category" 170
-----------------------------41184676334 Content-Disposition:
form-data; name="video"; filename="赤裸裸.mp3" Content-Type: audio/mpeg
文件内容。。。。二进制
-----------------------------41184676334 Content-Disposition: form-data;
name="width" 500 -----------------------------41184676334 Content-Disposition:
form-data; name="height" 400 -----------------------------41184676334
Content-Disposition:
form-data; name="ajax" 1 -----------------------------41184676334--



On Wed, May 2, 2012 at 3:17 PM, Uno Young <littlehaker@gmail.com> wrote:

> 一个form提交如下数据,
>
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="name" test ------WebKitFormBoundaryalsBj38a9JGJjeB2
> Content-Disposition: form-data; name="category" 170
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="video"; filename="20120301142002166.flv" Content-Type: video/x-flv
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="width" 500 ------WebKitFormBoundaryalsBj38a9JGJjeB2
> Content-Disposition: form-data; name="height" 400
> ------WebKitFormBoundaryalsBj38a9JGJjeB2 Content-Disposition: form-data;
> name="ajax" 1 ------WebKitFormBoundaryalsBj38a9JGJjeB2--
>
>
> 后台使用req.POST时,只有{multipart='true'},从而导致上传失败
>



-- 
Nothing is impossible.