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
I write the image to a folder using a unique name
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”
However when I explicitly set the location of the file that includes the file itself, it runs without issues.
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.