mu icon indicating copy to clipboard operation
mu copied to clipboard

problem with bad filenames with mu extract

Open SledgehammerPL opened this issue 9 years ago • 1 comments

Expected or desired behavior

All attachment extracted

Actual behavior

Only first attachment is extracted or only last attachment is extracted

Steps to reproduce

My contractor sends me two or more invoices by mail in pdf file format. The filename of attachment is the number of invoice. Unfortunately, the invoice number contains the '/' mark which is a problem:

Mu extractor ignores everything before last '/' assuming that this is a folder part of filename. Unfortunately - in my case the last part of invoice is identical: FU/1234/ABC/05.2016.pdf NA/345/BRE/05.2016.pdf

the result is that first attachment is saved as 05.2016.pdf and second raises error file exists. If I use --overwrite error isn't raised, but of course got only last invoice (which is correct behaviour of -overwrite).

I can get attachments one by one using -part= but this is complicated.

my proposal is to handle exception file exists and rename next occurence with .1, .2, .3, etc. as a default behaviour

alternatively you can add parameter --add_attachment_number_to_filename: which in my case produces this result:

2_05.2016.pdf 3_05.2016.pdf

SledgehammerPL avatar Jun 08 '16 13:06 SledgehammerPL

I think adding some numeric suffix is the more general solution here.

djcb avatar Jun 08 '16 16:06 djcb

This is really old, but if this is still a problem, can you attach an example message where this happens? We might use this for a unit test etc.

djcb avatar Jan 18 '23 17:01 djcb

This has gone stale, closing this.

djcb avatar Apr 30 '23 12:04 djcb