Shen Wang
08/22/2023, 8:09 PMPatrick
08/22/2023, 9:19 PMShen Wang
08/23/2023, 10:39 PMThanks Patrick for the help. here is code: <cfscript>
documentsData={
file="SPECSHEET-dept-phone-list-phone-list.pdf ",
filename="SPECSHEET-dept-phone-list-phone-list.pdf ",
caobjectId ='74972'
};
siteUrl="<https://instage.stlouis.gov/cityworks>";
pllDirectory = "E:\";
endUrl='#siteUrl#/Add?token=#token#&data=#serializeJSON(documentsData)#';
fileuploaded=#pllDirectory#&#documentsData.file#;
Cfhttp(URL="#endUrl#", method="POST", multipart="yes", result="apiResponse")
{
cfhttpparam(type="header", name="Access-Control-Allow-Origin", value="*");
cfhttpparam(type="header", name="Access-Control-Allow-Methods", value="POST, GET, OPTIONS, PUT");
cfhttpparam(type="header",name="file",value="#documentsData.file#");
cfhttpparam(type="FormField", name="Filename", value="#documentsData.file#");
cfhttpparam(type="File", name="#documentsData.file#", file="#fileuploaded#");
}
cfdump(var="#documentsData#");
cfdump(var="#apiResponse#");
</cfscript>