Reputation: 403
We have an XPages web app that allows users to upload files. An uploaded file is stored in a new Document's RichText field using the embedObject() function. This has been working fine for quite awhile now, but recently someone tried to upload a file named "test.dir", and it causes an exception in embedObject. Other typical file extensions we've tried work fine, and if we rename that same file to "test.txt" it works, but the ".dir" extension seems to cause a problem. Does anyone know what the problem might be with ".dir"? It's very strange! TIA.
Upvotes: 0
Views: 90
Reputation: 20384
You might want to take a complete different approach. embedObject
requires that you store the file temporary in the file system before you can attach it.
When you process your document instead of RichText as MIME, you can create an attachment MIME part and directly stream the uploaded data into that part without storing it in a temp location first.
Upvotes: 1
Reputation: 1417
In Domino, .dir
files are directory link files. I expect that this is the source of the issue.
Full details and background: https://www.ibm.com/support/knowledgecenter/en/SSKTMJ_9.0.1/admin/admn_creatingupdatinganddeletingdirectoryanddatabasel_t.html
You may be able to rename the file before embedding it as an attachment e.g. test.dir.txt
Upvotes: 3