Upload to S3 - PDF file upload issue

pdf
s3upload
business-process
rpaexpress

#1

Hi,
I’m using the following code to upload a pdf file into S3 in one of Business Process steps. I can see the file getting uploaded, however when I open the file I see it all blank. The size of file before upload and after upload more or less matches (but not exact size). I’ve pasted the code below. Am I missing any important step there?

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config" scriptlang="groovy">

<required name="ocrlink"/>

<var-def name="pdf_content">
	<file path="${ocrlink}" />
</var-def>

<var-def name="document_uuid">
    <template>${java.util.UUID.randomUUID().toString()}</template>
</var-def>

<var-def name="s3_invoice_link">
	<s3 bucket="public">
		<s3-put-public path='pretraining/pdf/${document_uuid}.pdf' content="${pdf_content}"/>
   	</s3>
</var-def>

<export include-original-data="true">
	<single-column name="s3_invoice_link" value="${s3_invoice_link}" />
</export>

</config>

Thanks
Jagathesh


#2

@JThangaswamy - are you using the RPA Express?


#3

Yes. I’m using RPA Express 1.1.0.

Thanks
Jagathesh


#4

@JThangaswamy -
It looks like the file you read with is empty of can not be read.
What is the value of the ${ocrlink} variable? Can you export it and make sure the file is there.


#5

${ocrlink} points to a file location (file://D/OCR.pdf). The file is getting uploaded and the size of the file also approximately similar to the original file (i do see some difference in file size).


#6

@JThangaswamy - try to upload the document to the S3 file storage and get the http link to it - https://kb.workfusion.com/display/RPAe/S3+File+Storage


#7

Hi azinchuk,
I am trying to do the same thing (uploading pdf files on S3) I am using the workfusion studio.
kindly find my code:

<?xml version="1.0" encoding="UTF-8"?>
  <export include-original-data="true">
    <single-column name="loss_run" value="${file_S3_Location}"/>
</export>

I am getting the output csv file with the http link. but when I am opening the link it is giving me error.

Kindly give me the correct solution.