# Files

To add files, use POST requests with each file transferred as a separate parameter named attach (n), where n is any seed value (see code example below).

Files can be added in the following methods:

* [post\_project](https://about/en/faq/api-projects.html#q1657) — creating a project
* [post\_task](https://about/en/faq/api-task.html#q1644) — creating a task
* [post\_comment](https://about/en/faq/api-comments.html#q1655) — posting a comment

***

Sample of adding files in post\_task request using PHP (curl) as an example:

```
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,'https://youraccount.worksection.com/api/admin/
v2/?action=post_task&id_project=PROJECT_ID&title=TASK_NAME&hash=HASH');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, [
  'attach[0]' = new cURLFile('path_to_file/local_file1.pdf',
'application/pdf','nice_name1.pdf'),
  'attach[1]' = new cURLFile('path_to_file/local_file2.pdf',
'application/pdf','nice_name2.pdf'),
]);
$response = json_decode(curl_exec($curl), true);
curl_close($curl);
```
