name | 此表单分区的名称。 |
data | 要上传的文件的原始内容。 |
fileName | 此表单分区上传的文件的名称。 |
contentType | 此节的 Content-Type 标头的值。 |
包含一个已命名文件分区,该分区基于 data
中的原始字节且具有自定义 Content-Type
和文件名。
完全控制选项。手动指定分区名称、原始数据、文件名和 Content-Type
。如果 fileName
为 null 或空,则名称默认为 file.dat
。如果 contentType 为 null 或空,则类型默认为 application/octet-stream
。
data | 要上传的文件的原始内容。 |
包含一个基于 data
中的原始字节的匿名文件分区,并指定默认的 Content-Type
和文件名。
基于来自 data
参数的原始字节创建文件分区。针对内容类型指定 application/octet-stream,并针对文件名指定 file.dat。
data | 要上传的文件的原始内容。 |
fileName | 此表单分区上传的文件的名称。 |
包含一个匿名文件分区,该分区基于 data
中的原始字节且具有特定文件名。指定默认的 Content-Type
。
针对 Content-Type
指定 application/octet-stream
。
name | 此表单分区的名称。 |
data | 要上传的文件的内容。 |
dataEncoding | 字符串编码。 |
fileName | 此表单分区上传的文件的名称。 |
包含一个已命名文件分区,其中包含从 data
提取的数据,并由 dataEncoding
进行编组。指定 fileName
中的特定文件名,以及默认的 Content-Type
。
Content-Type
假定为 text/plain
,具有从 dataEncoding
提取的 encoding
。如果 dataEncoding
为 null,则默认为 UTF8。
data | 要上传的文件的内容。 |
dataEncoding | 字符串编码。 |
fileName | 此表单分区上传的文件的名称。 |
一个匿名文件分区,其中包含从 data
提取的数据,并由 dataEncoding
进行编组。指定 fileName
中的特定文件名,以及默认的 Content-Type
。
如上所述,但未命名。
data | 要上传的文件的内容。 |
fileName | 此表单分区上传的文件的名称。 |
一个匿名文件分区,包含从 UTF8 字符串 data
提取的数据。指定 fileName
中的特定文件名,以及默认的 Content-Type
。
便捷方法。通过 data
字符串指定文件内容,并通过 fileName
指定文件名。假设字符串以 UTF8 编码。针对 Content-Type
指定 text/plain; encoding=utf8
。如果 fileName
为 null 或空,则指定文件名为 file.dat
。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.