Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2801

Re: Exception Caught!! payloadName Error!!

$
0
0

Hi Prashanth

 

Your logic does not do any renaming of the attachment. It just retrieves the attachment name from dynamic configuration (which was stored by mapping) and does nothing to it, it is just kept in the variable targetFileName.

 

In order to set the filename of the attachment, you need to set it in the Content Type of the attachment. The content type needs to be set in the following format, assuming you are only dealing with plain text MIME types.

text/plain;charset="UTF-8";name="file.txt"

 

To do this, you need to use setContentType() method of the Payload interface. For your case, you can do something like below:-

 

payload.setContentType("text/plain;charset=\"UTF-8\";name=\"" + targetFileName + "\"");

Make sure this is after the variable has been populated.

 

Rgds

Eng Swee


Viewing all articles
Browse latest Browse all 2801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>