# Not able to download image from JIRA to local using image url in c#

**URL:** <https://community.developer.atlassian.com/t/not-able-to-download-image-from-jira-to-local-using-image-url-in-c/25282>\
**Category:** Jira Cloud\
**Created:** [November 28, 2018, 11:50am UTC](https://community.developer.atlassian.com/t/not-able-to-download-image-from-jira-to-local-using-image-url-in-c/25282 "2018-11-28T11:50:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganesh.m](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@ganesh.m](https://community.developer.atlassian.com/u/ganesh.m)\
**Post date:** [November 28, 2018, 11:50am UTC](https://community.developer.atlassian.com/t/not-able-to-download-image-from-jira-to-local-using-image-url-in-c/25282/1 "2018-11-28T11:50:25Z")

</div>

I have used the below url to get information of particular issue

```auto
“https://domainName.atlassian.net/rest/api/latest/issue/” + issueId + “/”

```

In that info I am able to get attachments urls included in that issue  
I have used below code to download that attachments to my local path.

```auto
webClient.DownloadFile(imageurl, localpath);

```

Able to download but the file getting corrupted

Please help me on this or else suggest me the way to download the image to my local path

---

<div class="post-metadata">

**Author:** ![rmassaioli](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rmassaioli/32/35834_2.png) [@rmassaioli](https://community.developer.atlassian.com/u/rmassaioli)\
**Post date:** [December 7, 2018, 6:02am UTC](https://community.developer.atlassian.com/t/not-able-to-download-image-from-jira-to-local-using-image-url-in-c/25282/2 "2018-12-07T06:02:15Z")

</div>

Could you please provide a more complete example of what you are trying to do? Cheers.

Also, what is the output of running the `file` command on the downloaded files?

---

<div class="post-metadata">

**Author:** ![ganesh.m](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@ganesh.m](https://community.developer.atlassian.com/u/ganesh.m)\
**Post date:** [December 7, 2018, 7:14am UTC](https://community.developer.atlassian.com/t/not-able-to-download-image-from-jira-to-local-using-image-url-in-c/25282/3 "2018-12-07T07:14:01Z")

</div>

Below is the url of attachment I am getting from JIRA.

> **[Log in with Atlassian account](https://plural.atlassian.net/login.jsp?permissionViolation=true&os_destination=%2Fsecure%2Fattachment%2F10420%2Flocal%2Blogin.png&page_caps=&user_role=)**
>
> Log in to Jira, Confluence, and all other Atlassian Cloud products here. Not an Atlassian user? Sign up for free.

I have used ‘webClient.DownloadFile(imageurl, localpath);’ to download that attachment.  
Attached the output file after downloading.

 ![Corrupted%20attachment](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/7/c/7ccac4a8f81c4bc49b0d037f10b2c60f4de4b277.png)
