【问题标题】:How can I implement the multiple selection of image file(s) at uploading如何在上传时实现图像文件的多项选择
【发布时间】:2022-01-21 05:46:30
【问题描述】:

我想让我的程序一次选择并上传多个文件。

【问题讨论】:

标签: html css


【解决方案1】:

我使用了多个这样的内部标签:

    <input
                className="btn-browse"
                type="file"
                onChange={onChangeHandler}
                accept=".jpeg, .jpg, .png, .gif, .bmp"
                multiple
            />

【讨论】:

    【解决方案2】:

    我们可以通过在输入标签中提供Multiple属性来上传多个文件。

     h1 {
                color: green;
            }
             
            .container {
                text-align: center;
                width: 850px;
                margin: 35px;
            }
             
            .property {
                width: 400px ;
                float: left;
                border: 2px solid black;
                padding: 10px;
            }
            .attribute {
                width: 400px ;
                float: right;
                border: 2px solid black;
                padding: 10px;
            }
    <body>
        <div class="container">
            <div class="property">
                <form action="/action_page_inputtags_multiplefiles.php">
                    <label for="files">Select Multiple files:</label>
                    <input type="file" id="files" name="files" multiple>
                </form>
            </div>
    </body>
     
    </html>

    【讨论】:

      猜你喜欢
      • 2015-04-04
      • 2011-11-16
      • 1970-01-01
      • 2018-09-24
      • 2021-09-20
      • 1970-01-01
      • 1970-01-01
      • 2020-05-05
      • 2018-04-04
      相关资源
      最近更新 更多