Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php FormPanel不在Firefox中上载文件_Php_Firefox_Gwt - Fatal编程技术网

Php FormPanel不在Firefox中上载文件

Php FormPanel不在Firefox中上载文件,php,firefox,gwt,Php,Firefox,Gwt,有特殊问题的 我正在使用FormPanel将数据发送到数据库并上载文件 在Chrome中,这很好,但在Firefox中,它将数据发送到数据库,但不上传文件。Firebug返回以下错误: Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form. The file will not be sent. 我觉得这很奇怪。 查看页面源代码,一切正常: <f

有特殊问题的

我正在使用FormPanel将数据发送到数据库并上载文件

在Chrome中,这很好,但在Firefox中,它将数据发送到数据库,但不上传文件。Firebug返回以下错误:

Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form.  The file will not be sent.
我觉得这很奇怪。 查看页面源代码,一切正常:

<form target="FormPanel_revanweb_1" action="phpFiles/newBookmark.php" enctype="ENCODING_MULTIPART" method="POST" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;" class="gwt-TabLayoutPanelContent">

这是我如何使用UiBinder构建表单面板的:

<g:FormPanel ui:field="formPanel" action="phpFiles/newBookmark.php" method="POST" encoding="ENCODING_MULTIPART">
    <g:VerticalPanel ui:field="tabNewWrapper" stylePrimaryName="tabNew-wrapper">
        <g:HTMLPanel ui:field="bookmarkNamePanel" styleName="container">
            <g:Label text="Bookmark Name:" />
            <g:TextBox name="txtBookmarkName" ui:field="txtBookmarkName" width="100%" />
        </g:HTMLPanel>
        <g:HTMLPanel ui:field="bookmarkURLPanel" styleName="container">
            <g:Label text="Bookmark URL:" styleName="label" />
            <g:TextBox name="txtBookmarkURL" ui:field="txtBookmarkURL" width="100%" />
        </g:HTMLPanel>
        <g:HTMLPanel ui:field="bookmarkDescriptionPanel" styleName="container">
            <g:Label text="Bookmark Description" styleName="label" />
            <g:TextArea name="txtBookmarkDescription" ui:field="txtBookmarkDescription" width="100%" height="60px" />
        </g:HTMLPanel>
        <g:HTMLPanel ui:field="bookmarkImgUploadPanel" styleName="container">
            <g:Label text="Image:" styleName="label" />                             
                <g:VerticalPanel ui:field="vpForm">
                    <g:FileUpload name="logo" ui:field="uploadFile" />
                </g:VerticalPanel>
        </g:HTMLPanel>
        <g:HTMLPanel ui:field="bookmarkcbActivePanel" styleName="container">
            <g:CheckBox  name="cbActive" ui:field="cbActive" text="Active?" styleName="label" />
        </g:HTMLPanel>
        <g:HTMLPanel ui:field="bookmarkTagsPanel" styleName="container">
            <g:Label text="Tags:" styleName="label" />
            <g:SuggestBox ui:field="sbBookmarkTags" animationEnabled="true" width="100%" />
        </g:HTMLPanel>
        <g:HTMLPanel ui:field="btnOKPanel" styleName="container">
            <g:SubmitButton ui:field="btnSubmit" text="OK" styleName="buttonOK" />
            <g:Label ui:field="lblWarning" visible="false" styleName="warning" />
            <g:Hidden ui:field="sessionID" name="sessionid" visible="false" />
        </g:HTMLPanel>
    </g:VerticalPanel>
</g:FormPanel>

您正在将编码设置为
编码\多部分
,而不是
多部分/表单数据


注意:
ENCODING\u MULTIPART
String
类型的常量,它不是枚举<
FormPanel
上的code>setEncoding将
字符串作为参数;因此,如果您在ui.xml中编写ENCODING\u MULTIPART,您将把字符串设置为
“ENCODING\u MULTIPART”
,而不是
FormPanel.ENCODING\u MULTIPART
常量的值(顺便说一句,该常量只能在ui.xml中使用
引用,然后用作
{ENCODING\u MULTIPART}

谢谢。我不知道使用UiBinder时是这样的。