# AddBinaryData(string, byte[], string, string)

> Add binary data to the form.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.UnityWebRequestModule

```csharp
public void AddBinaryData(string fieldName, byte[] contents, string fileName, string mimeType)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Remarks

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 mimeType is not given and first 8 bytes of the data match PNG format header, then the data is sent with "`image/png`" mimetype. Otherwise it is sent with "`application/octet-stream`" mimetype.
