Skip to main content
Cadet | Tier 2
February 12, 2026
Question

"Unable to get the file path when value is created using file stream connection" error

  • February 12, 2026
  • 8 replies
  • 124 views

I’m trying to have my bot download a file.

I cannot use the Download File action because I need to provide a custom header. Instead I use the Rest Web Services: Get File Stream action.

I use the URI “https://www.cte.iup.edu/cte/Resources/PDF_TestPage.pdf”, and store the download in my “TheFile” variable. (Although this URI doesn’t actually need the aforementioned custom header, my actual for-realsies URI would.)

Then I use the Utils: Copy File action with a Source as “$TheFile$” and a Destination as “myDownloadedFile.pdf”.

When I run this, it throws an exception when trying to execute the Utils: Copy File action. The exception says "Unable to get the file path when value is created using file stream connection".

Am I doing something wrong? Or why doesn’t this work?

8 replies

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
February 12, 2026

@AugustZellmer2 It sounds like you’re making this too difficult.

In the REST Web Services: GET method action, there is the opportunity to save the downloaded file onto your local drive.

You can specify whatever filename you want for the downloaded file. 

Cadet | Tier 2
February 12, 2026

Selecting that option on the REST Web Services: GET Method action doesn’t download the file. It doesn’t error either; it just doesn’t do anything for me. Am I missing something? 🤔

 

 

 

 

(I also tried it without the custom header I’m trying to use. It still didn’t download the file.)

Tamil Arasu10
Most Valuable Pathfinder
Most Valuable Pathfinder
February 12, 2026

Can you please enable the capture failure response, this option to log the failure responses which helps to find the issue.

_Tamil_
Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
February 12, 2026

@AugustZellmer2 Yeah, I’ve seen that in certain web server configurations.

Really, you only have a few options since you need a custom header. (That excludes the Browser: Download file action because it doesn’t support custom headers.) That leaves things like a Python or Powershell script to download the file. Using the Invoke-WebRequest command in Powershell comes to mind as it supports custom headers and the ability to save files.

Invoke-WebRequest "https://www.cte.iup.edu/cte/Resources/PDF_Sample.pdf" -Headers @{ "got_receipt" = "true" } -OutFile "PDF_Sample.pdf"

Hope that helps.

Cadet | Tier 2
February 12, 2026

Can you please enable the capture failure response, this option to log the failure responses which helps to find the issue.

I enabled it. Where does it log the failures to?

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
February 12, 2026

@AugustZellmer2 It goes to the output variable. I don’t think you’ll see anything in the failure response. It wouldn’t surprise me to see the binary PDF contents in the output variable though!

Cadet | Tier 2
February 12, 2026

@AugustZellmer2 Yeah, I’ve seen that in certain web server configurations.

Really, you only have a few options since you need a custom header. (That excludes the Browser: Download file action because it doesn’t support custom headers.) That leaves things like a Python or Powershell script to download the file. Using the Invoke-WebRequest command in Powershell comes to mind as it supports custom headers and the ability to save files.

Invoke-WebRequest "https://www.cte.iup.edu/cte/Resources/PDF_Sample.pdf" -Headers @{ "got_receipt" = "true" } -OutFile "PDF_Sample.pdf"

Hope that helps.

Okay, I’ll write some script to do it. Thanks for your input!

Cadet | Tier 2
March 26, 2026

LongPathTool helped handle deep file paths so file operations worked after saving the stream properly.