on 2024 Aug 09 7:34 AM
I am reading a PDF file from Azure Blob/SFTP and need to pass that to ECM. All text files are going properly but for PDF file it is storing in ECM successfully but while downloading, a blank pdf is showing. After reading the pdf from source, when I am checking that in CPI, is showing in a symbolic pattern. While placing this same to al11, I am getting the proper PDF but while passing this to ECM, it is showing blank pdf.
To make this working I am passing content type as "application/pdf" along with "multipart/form-data; boundary=CPI" as required for ECM. Do I need to pass any specific matadata in fileProperty, so that pdf will be stored properly?
Hi ,
To make this working I am passing content type as "application/pdf" along with "multipart/form-data; boundary=CPI" as required for ECM. Do I need to pass any specific metadata in file Property, so that pdf will be stored properly?
My comments :
Yes, ensure you pass the following metadata along with the file:
Content-Type: application/pdf
Content-Disposition: attachment; filename="filename.pdf"
Sample usage :
def fileContent = new File("/path/to/your/file.pdf").text
def fileName = "file.pdf"
transformFileToECM(fileContent, fileName)
Regards ,
Azmath.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Azmath,
Now I am sending as below..
--CPI
Content-Type: application/pdf
Content-Disposition: attachment; filename="${property.ExtractedfileName}"
${header.file}
--CPI
Content-Disposition: form-data; name="fileProperties"
${header.fileProperties}
--CPI--
but getting following error:
{
"traceId": "Id-777575757775757757575577",
"error": {
"code": 400,
"message": "File is empty. Please provide file to be uploaded.",
"target": "https://abcdefgh.com/enterprise-documents-api/api/v1/repositories/ecm-PropertyServices/documents"
}
}
Previously while file was going but showing blank pdf:
--CPI
Content-Disposition: form-data; name="file"; filename="${property.ExtractedfileName}"
${header.file}
--CPI
Content-Disposition: form-data; name="fileProperties"
${header.fileProperties}
--CPI--
User | Count |
---|---|
76 | |
11 | |
10 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.