HttpRequest upload file

Hi community,

I am trying to sent this PUT request to upload a file.
I am not sure how to translate this Body/binary into Studio’s Body.

Would you have any suggestion?
There is a very good tutorial here: HTTP REQUEST - POST - UNRECOGNIZED UPLOADED FILE - #6 by Cristian_Negulescu. Thank you @Cristian_Negulescu! but probably my API architecture is different than what is shown.
On HttpRequest documentation (https://docs.uipath.com/activities/docs/http-client) are not many details.

Thank you for any thoughts.
Regards,
Coty

PS: I hope the same subject wasn’t explained somewhere else. I haven’t found on Forum

Hi,

I already faced this issue. The solution was to convert the body of the file into a base64 variable and put it inside the body. But it was a POST request. So maybe you need to convert the file before trying to upload it.

Good luck

Hello Coty,
To solve this issue I write VB.NET code and invoke code all the code you will find in the description of the videos:

Thanks,
Cristian

Hi Melanie,
Thanks for your reply. Would that work for 600 MB .zip files?
Regards,

Hi Cristian,
Thank you for your tutorials and ideas. Same question, would that work for 600 MB .zip files?
Regards,
Coty

I never tested. Is VB.NET code I don’t know how to go lower in UiPath Studio.

Hi Cristian,
I am trying the C# bit. I have two more questions:
Any idea why do I get this error:
“Main.xaml: No compiled code to run
error CS4033: The ‘await’ operator can only be used within an async method. Consider marking this method with the ‘async’ modifier and changing its return type to ‘Task’. At line 11
error CS4033: The ‘await’ operator can only be used within an async method. Consider marking this method with the ‘async’ modifier and changing its return type to ‘Task’. At line 13”

And:
my file is uploaded in Postman, using the Body/binary method. How this should be changed in the MultipartFormDataContent?

Thank you again for your support and for the tutorials.
Coty

Hello Coty,
Try to avoid Await because you need Async I don’t know how to use this UiPath Studio. In Visual Studio you can do this but here I don’t know.
Try to use RestSharp instead of default HTTPrequest
https://restsharp.dev/usage/files.html

Thanks,
Cristian