AddBinaryData(string, byte[], string, string)
Add binary data to the form.
Read time 1 minuteLast updated 21 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.UnityWebRequestModule
public void AddBinaryData(string fieldName, byte[] contents, string fileName, string mimeType)
Parameters
The name of the field to add.
The binary data to upload.
The file name to use when saving the uploaded file on the server. If , Unity generates a file name from .
nullfieldNameThe MIME type of the uploaded data. If , Unity uses when the data starts with a PNG header, otherwise .
nullimage/pngapplication/octet-streamRemarks
Use this function to upload files and images to a web server application. Note that the data is read from the contents of byte array and not from a file. The fileName parameter is for telling the server what filename to use when saving the uploaded file.
If is not given and first 8 bytes of the data match PNG format header, then the data is sent with "" mimetype. Otherwise it is sent with "" mimetype.
mimeTypeimage/pngapplication/octet-stream