# Can't attach image to a task

**URL:** <https://forum.asana.com/t/cant-attach-image-to-a-task/41955>\
**Category:** API & Developers\
**Created:** [12 February 2019 18:14 UTC](https://forum.asana.com/t/cant-attach-image-to-a-task/41955 "2019-02-12T18:14:24Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [13 November 2019 07:00 UTC](https://forum.asana.com/t/cant-attach-image-to-a-task/41955/8 "2019-11-13T07:00:35Z")

</div>

Well, you may be making progress!

Take a look at this post - I think you need to change the filename as Ross indicates:

> [@How to upload a file to a task in ASANA api using c#](https://forum.asana.com/t/how-to-upload-a-file-to-a-task-in-asana-api-using-c/44189/2):
>
> Hey @Zahid_Abbasli, I played around with it, and was able to get it working by comparing it to our [Java client library](https://github.com/Asana/java-asana/blob/master/src/main/java/com/asana/resources/Attachments.java), temporarily adding [HttpClient logging](https://stackoverflow.com/questions/18924996/logging-request-response-messages-when-using-httpclient), and comparing it to what’s expected in our [attachment docs](https://asana.com/developers/api-reference/attachments#upload) The ‘name’ is expected to be the word “file”, including the quotes. Just change this line and you should be good to go. form.Add(new ByteArrayContent(bytes, 0, bytes.Length), "\"file\"", "\"example.jpg\""); You may also want to change this line to use a random string to ensure …

In other words, I think at the beginning of the content it should be like:

> Content-Disposition: form-data; name=“file”; filename=“example.txt”  
> Content-Type: text/plain

---

_[View the full topic](https://forum.asana.com/t/cant-attach-image-to-a-task/41955)._
