# HttpRequest FileUpload Error in C# - but works via Postman

**URL:** <https://community.postman.com/t/httprequest-fileupload-error-in-c-but-works-via-postman/32876>\
**Category:** Help Hub\
**Created:** [February 23, 2022, 4:59pm UTC](https://community.postman.com/t/httprequest-fileupload-error-in-c-but-works-via-postman/32876 "2022-02-23T16:59:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crispinaugustine](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crispinaugustine](https://community.postman.com/u/crispinaugustine)\
**Post date:** [February 23, 2022, 4:59pm UTC](https://community.postman.com/t/httprequest-fileupload-error-in-c-but-works-via-postman/32876/1 "2022-02-23T16:59:32Z")

</div>

Dear Community,  
I tried uploading a file through Postman UI, which works very well.  
However, it’s equivalent C# HttpRequest based code gives a “Badrequest” error (invalid value - File)

Postman Console shows the value: “Undefined” for “File”, which doesn’t tell enough about the Type / Encoding that needs to be used here.  
 ![PostmanPost](https://us1.discourse-cdn.com/getpostman/original/3X/8/9/89dc086706d7967b85efcece824a7b0d6cbf61ca.png)

Is there a way to see the value for “File” that is sent with the request?  
Appreciate any help. Thanks in advance.

Kind regards,  
Crispin

---

<div class="post-metadata">

**Author:** ![glamartina](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@glamartina](https://community.postman.com/u/glamartina)\
**Post date:** [April 22, 2024, 4:44pm UTC](https://community.postman.com/t/httprequest-fileupload-error-in-c-but-works-via-postman/32876/2 "2024-04-22T16:44:23Z")

</div>

Did you ever figure this out? I’m having a similar endpoint issue that uploads a pdf through Postman but nothing I’ve tried in C#/RestSharp works…
