当没有上传文件时,带有enctype ='multipart / form-data'的表单不起作用

时间:2015-04-14 14:42:35

标签: php forms upload

我有一个这样的表格

        <form role="form" class="form-inline" action='pageadd.php' method='post' enctype='multipart/form-data'>
<table class='formTable'>
    <tr>
        <td>Name</td>
        <td>:</td>
        <td><input type="text" maxlength='140' class="form-control" size='50' name='title' /></td>
    </tr>
    <tr>
        <td>Photo</td>
        <td>:</td>
        <td>
      <input type="file" name='myphoto'/><br/>
    </td>
    </tr>
    <tr>
        <td>Content</td>
        <td>:</td>
        <td>
      <textarea name='content' style='width:100%;height:240px;'></textarea>
        </td>
    </tr>
    <tr>
        <td colspan='3'><input type="submit" class="btn btn-success" name='save' value='Save' /></td>
    </tr>
</table>
</form>

我更喜欢照片上传是可选的

但问题是当没有上传照片时,表单无效,有人知道或者发现同样的问题吗?

0 个答案:

没有答案