Skip to main content

4.3. 单个表单字段的多个文件

4.3. Multiple Files for One Form Field

🇬🇧 英文原文

To supply multiple files for one form field, there are three possibilities:

  1. Include multiple instances of the same field name in the form with different values. This is the recommended approach.

  2. Use a Content-Type of "multipart/mixed" for a single form field that contains the multiple files. However, this approach is deprecated and SHOULD NOT be used for new implementations.

  3. Include multiple file names in one filename parameter, e.g., filename="file1.txt, file2.gif". However, such usage is non-standard and implementation support varies.

🇨🇳 中文翻译

要为一个表单字段提供多个文件,有三种可能性:

  1. 在表单中包含同一字段名称的多个实例,使用不同的值。这是推荐的方法。

  2. 对包含多个文件的单个表单字段使用 "multipart/mixed" 的 Content-Type。然而,这种方法已被弃用,对于新的实现不应该 (SHOULD NOT) 使用。

  3. 在一个 filename 参数中包含多个文件名,例如,filename="file1.txt, file2.gif"。然而,这种用法是非标准的,实现支持各不相同。