Menu

Filename without signature and timestamp

Help
2017-03-17
2017-03-17
  • Ioan Theodor

    Ioan Theodor - 2017-03-17

    Hello guys,

    Is it possible to save the incoming files with the original filename. Like in this case:
    testinv_48_3_4.xml-OPENAS2-17032017212724_0200-9987@OpenAS2A_OID_OpenAS2B_OID.27aa65b4-8cb6-4a84-8a1f-81434d3372e2 This is the acctual received filename
    testinv_48_3_4.xml This is how I wanted to be

    Do you think is possible?

    Thank you.

     
  • Christopher Broderick

    Look in the config.xml file.

    The default handler and filename is this snippet:

     <module classname="org.openas2.processor.storage.MessageFileModule"
                filename="%home%/../data/$msg.sender.as2_id$-$msg.receiver.as2_id$/inbox/$msg.content-disposition.filename$-$msg.headers.message-id$"
                header="%home%/../data/$msg.sender.as2_id$-$msg.receiver.as2_id$/msgheaders/$date.yyyy-MM-dd$/$msg.content-disposition.filename$-$msg.headers.message-id$"
                protocol="as2"
                tempdir="%home%/../data/temp"/>
    

    You change the "filename" attribute to suit your puprposes which according to your cmment above needs to look something like this:

     <module classname="org.openas2.processor.storage.MessageFileModule"
                filename="%home%/../data/$msg.sender.as2_id$-$msg.receiver.as2_id$/inbox/$msg.content-disposition.filename$"
                header="%home%/../data/$msg.sender.as2_id$-$msg.receiver.as2_id$/msgheaders/$date.yyyy-MM-dd$/$msg.content-disposition.filename$-$msg.headers.message-id$"
                protocol="as2"
                tempdir="%home%/../data/temp"/>
    
     
  • Ioan Theodor

    Ioan Theodor - 2017-03-19

    Great. Got it!

    Thanks a lot.

     
  • Ioan Theodor

    Ioan Theodor - 2017-03-19

    Hi Christopher,

    I have updated the config file as you told me and it removed some content but it still remain a part of it. Do you think you can help me to get rid of that part too?

    factura_2231.xml.23e24931-86a3-46a7-888f-dbf87d99ac09
    I want to have just the original file name dot his extension :D
    factura_2231.xml

    Thank you!

     
  • Ioan Theodor

    Ioan Theodor - 2017-04-06

    Kind reminder

     
  • Christopher Broderick

    Sorry, I missed your last post.
    I did not test the solution I gave you and having now done so I found the same problem and in looking at the code found that the UUID is automatically added.

    I have made a code change to remove this and you can test it using the upcoming release snapshot here: https://sourceforge.net/projects/openas2/files/OpenAS2Server-2.2.3-SNAPSHOT.zip/download

     
  • Nick

    Nick - 2017-04-08

    It should work, I've just tested it.

     

Log in to post a comment.