Hi all,
I seem to be getting a strange error when trying to attach an image from a feature layer in AGOL to Cityworks using the HTTP caller. My goal is to download and upload each unique image from the AGOL feature layer and attach it to the correct Work Order (i.e. picture of stop sign for sign work order, picture of a pothole for a pothole worker). My workflows is as follows, read in the AGOL feature layer, save each image using the AttributeFileWritter, create the work order, attach the image using the HTTP Caller. The error occurs when I try to upload the image will using a variable name in the output PATH + .jpeg extension. When I explicitly set the image in the file upload, it runs no problem. However when I use the variable name in the path I get a “ HTTPCaller_2 (HTTPFactory): o11]: HTTP transfer error: HTTP/FTP Transfer: Failed to open file 'C:\Path\To\Documents\WorkOrder_Pictures\.jpeg' for resource upload”.
Here is my Cityworks API call
![](https://uploads-us-west-2.insided.com/safesoftware-en/attachment/da3915d2-5b69-4466-bc01-0defbc69b78e.png)
I write the image to a folder using a unique name
![](https://uploads-us-west-2.insided.com/safesoftware-en/attachment/fda074f4-ddbf-4d97-afc8-46d3a5e3eb23.png)
When I set the location of the file to be uploaded in the HTTP caller to the PATH plus variable name I get this error “TTPCaller_2 (HTTPFactory): H11]: HTTP transfer error: HTTP/FTP Transfer: Failed to open file 'C:\Path\To\Documents\WorkOrder_Pictures\.jpeg' for resource upload”
![](https://uploads-us-west-2.insided.com/safesoftware-en/attachment/0e8a39c8-7ca4-43ac-b06f-0c50e8fe121c.png)
However when I explicitly set the location of the file that includes the file itself, it runs without issues.
![](https://uploads-us-west-2.insided.com/safesoftware-en/attachment/ad5445d5-9e81-4776-b0aa-5d96b489ef57.png)
Unfortunately I cannot upload the same image over and over again and would like to upload a unique image that is being downloaded from the AGOL layer. I have tried to force the PATH by creating a new attribute with the name of the file + extension and that still produced the same error. I have also tried writing temporary files with no luck either. I am aware of a similar post made 1 year ago but the solution did not work for me.
Wondering if anyone has had a similar experince.