One of our partners always sends us AS2 messages with the same filename, even though the contents are different. To handle this use case, we make sure that the "Keeo Original Filename" is NOT set for the partner.
This works well in the Inbox as it create a new file for every message with filename: <msg_id>.msg.
However, there is a problem with the Message model's payload FileField. The logic used for the file field overwrites the previous file if it is sent on the same day. Here is the relevant code:
payload = models.FileField(upload_to=get_message_store, null=True, blank=True)
One of our partners always sends us AS2 messages with the same filename, even though the contents are different. To handle this use case, we make sure that the "Keeo Original Filename" is NOT set for the partner.
This works well in the Inbox as it create a new file for every message with filename:
<msg_id>.msg
.However, there is a problem with the Message model's payload FileField. The logic used for the file field overwrites the previous file if it is sent on the same day. Here is the relevant code:
payload = models.FileField(upload_to=get_message_store, null=True, blank=True)
This code will generate the same filename for multiple records, which results in the last record overwriting files from previous ones.
Perhaps the msg_id should be added to the target_dir?