Hi,
I am using http post method where I need to send pdf file along with the api.
Below is my configuration that I put in the http request activity.
I am getting response as below
I have already mentioned the full file path still its showing the above response.
Can anyone please suggest what can be the issue over here ?
Hi! @Debartha_Mitra_DE ,
Pass the file path through a variable with the extension “.pdf”.
Regards,
NaNi
Hi,
Thanks for your response, I did it in this way as well.
But no luck.
Hi!
please try this.
fileNamePath=Directory.getfiles("D:/-----.pdf").ToString
Regards,
NaNi
Hi,
you mean to say similar like this ?
Directory.getfiles(“C:/Users/DE118723/Documents/UiPath/UiPath DocDigitizer API/Rechnung201Redacted.pdf”).ToString
This code is throwing error (invalid directory name) as this code usually asks for directory name not the file name
Let me know if I am making any mistake or not.
hey! try like this
Use assign activity :
fileNamePath=directory.GetFiles(FolderPath)
FolderPath= Path of folder where your files are present
Use for each activity
Inside body of for each use if condition activity
item.Contains(“.pdf”)
Here you’ll get the files which contains the .pdf extension.
Regards,
Hi
Have a view on these threads for different approaches
Hello @Nagareetha_Baskaran !
It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.
First, make sure you browsed through our Forum FAQ Beginner’s Guide . It will teach you what should be included in your topic.
You can check out some of our resources directly, see below:
Always search first. It is the best way to quickly find your answer. Check out the [image] icon for that.
Clicking the options button will le…
I am trying to upload a file via HTTP request
My process before downloads files successfully, but I can’t work out how to get the files back up there once complete.
essentially I want to loop through a folder and upload the documents there.
Anyone else had success in this area?
Not sure how to replicate the following attributes in the body
[image]
[image]
Cheers @Debartha_Mitra_DE
I tried this but it threw the same error
I need to send pdf file through rest api request, i tried to use the below code to upload it mentioned in
I am trying to upload a file via HTTP request
My process before downloads files successfully, but I can’t work out how to get the files back up there once complete.
essentially I want to loop through a folder and upload the documents there.
Anyone else had success in this area?
Not sure how to replicate the following attributes in the body
[image]
[image]
and this is my code in the invoke code activity
Dim client As RestClient = New RestClient("https://xxcccc")
client.Timeout = -1
Dim request As RestRequest = New RestRequest(Method.POST)
request.AddHeader("Authorization", "token key")
request.AddHeader("Content-Type", "application/octet-stream")
request.AddHeader("Content-Disposition", "form-data")
request.AddParameter("filename", "Rechnung201Redacted.pdf")
request.AddFile("file", "C:\Users\DE118723\Documents\UiPath\UiPath DocDigitizer API\Rechnung201Redacted.pdf")
Dim response As IRestResponse = client.Execute(request)
Console.WriteLine(response.Content)
can you please tell what can be the issue over here, its not working
@gustavo.cervelin if you can also help me here it will be very helpful