# Upload file in api using invoke code (C# code)

**URL:** <https://forum.uipath.com/t/upload-file-in-api-using-invoke-code-c-code/490611>\
**Category:** Studio\
**Tags:** question, studio, system, webapi, activities\
**Created:** [November 16, 2022, 8:58am UTC](https://forum.uipath.com/t/upload-file-in-api-using-invoke-code-c-code/490611 "2022-11-16T08:58:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harsh\_Shinde](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/harsh_shinde/32/337351_2.png) [@Harsh\_Shinde](https://forum.uipath.com/u/Harsh_Shinde)\
**Post date:** [November 16, 2022, 8:58am UTC](https://forum.uipath.com/t/upload-file-in-api-using-invoke-code-c-code/490611/1 "2022-11-16T08:58:27Z")

</div>

![IMG_20221116_142346](https://global.discourse-cdn.com/uipath/original/4X/7/8/7/7878b1e42c48090cdf7ec8ce6c397279d96f383b.jpeg)

Instead of this [VB.Net](http://VB.Net) code I want C# code to upload file in API. Because .Net code is not working in my case.

 ![IMG_20221116_142253](https://global.discourse-cdn.com/uipath/original/4X/5/a/c/5ac8687c026492af7c3a36c1c6e0e40da802b181.jpeg)

This is image of API I am using

---

<div class="post-metadata">

**Author:** ![Edwin\_Barahona](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edwin_barahona/32/310876_2.png) [@Edwin\_Barahona](https://forum.uipath.com/u/Edwin_Barahona)\
**Post date:** [November 16, 2022, 4:38pm UTC](https://forum.uipath.com/t/upload-file-in-api-using-invoke-code-c-code/490611/2 "2022-11-16T16:38:03Z")

</div>

Hi @Harsh_Shinde ,

If you want to invoke C# code, you will need to switch your project from Visual Basic to C#, if you’re using studio pro you can do it by modifying your project.json and reload it. Otherwise, you will need to create a new project based on C#.

![image](https://global.discourse-cdn.com/uipath/original/4X/c/d/b/cdb92c4a22d2f8712dc3f404890576c3e1b41e15.png)

As an alternative, you could simply use the http request activities provided in the webapi library

![image](https://global.discourse-cdn.com/uipath/original/4X/3/9/6/3961be20c6529cfd375f99f0f4148a7d9f0d5055.png)

![image](https://global.discourse-cdn.com/uipath/original/4X/c/8/4/c847c94dbcb2d57e5841b0bfaf6cc6439e522948.png)

 ![image](https://global.discourse-cdn.com/uipath/original/4X/5/6/0/56045f938b322f14dc620b0b04eb5a9c82909203.png)

[HTTP Request (uipath.com)](https://docs.uipath.com/activities/lang-es/docs/http-client)

---

<div class="post-metadata">

**Author:** ![Harsh\_Shinde](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/harsh_shinde/32/337351_2.png) [@Harsh\_Shinde](https://forum.uipath.com/u/Harsh_Shinde)\
**Post date:** [November 17, 2022, 3:57am UTC](https://forum.uipath.com/t/upload-file-in-api-using-invoke-code-c-code/490611/3 "2022-11-17T03:57:13Z")

</div>

@Edwin_Barahona Thanks Edwin

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [November 20, 2022, 3:58am UTC](https://forum.uipath.com/t/upload-file-in-api-using-invoke-code-c-code/490611/4 "2022-11-20T03:58:05Z")

</div>

Closed on November 20, 2022, 3:58am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
