Mime type for emails/outlook do not work

7 views
Skip to first unread message

Mani

unread,
Jun 3, 2020, 12:59:50 AM6/3/20
to Orbeon Forms
Hi Alex - I want to restrict the file types of an upload control to only certain apps adn one of them is outlook. Using "application/vnd.ms-outlook" do not work. Please let me know what to use to allow emails to be uploaded

Thanks
Manish

Alessandro Vernet

unread,
Jun 3, 2020, 5:42:27 PM6/3/20
to orb...@googlegroups.com
Hi Manish,

I am not sure to understand your use case. Can you maybe give us an example
of what file you want to accept or not accept, and what you are seeing now?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/
Message has been deleted

Mani

unread,
Jun 3, 2020, 10:19:39 PM6/3/20
to Orbeon Forms
I would like the users to upload only .msg, .txt, .pdf, .xml and .doc files. For this I'm using 

xxf:upload.mediatypes="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.ms-excel application/pdf application/vnd.openxmlformats-officedocument.wordprocessingml.document application/msword application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text text/* application/vnd.ms-outlook application/vnd.ms-outlook-pst"

This still wouldn't allow the .msg or outlook files to be uploaded.

Alessandro Vernet

unread,
Jun 5, 2020, 9:12:13 PM6/5/20
to orb...@googlegroups.com
Hi Manish,

I am wondering if this is because the correct mediatype isn't associated to
the `.msg` file you upload. That mediatype is provided by the browser. If
you enable the XForms Inspector and you upload a file, what is the value of
the `mediatype` attribute in the data?

As far as the logic goes, up to 2019.2, Orbeon Forms strictly uses the
mediatype it gets from the browser. Starting with 2020.1, produces a
mediatype based on the file extension in those cases where the browser
doesn't doesn't send the correct mediatype, which is something that might
help you if in your case the browser doesn't send a mediatype for `.msg`
files.

https://github.com/orbeon/orbeon-forms/issues/4474

You'll let me know what your findings are.

Alessandro Vernet

unread,
Jun 12, 2020, 6:46:06 PM6/12/20
to orb...@googlegroups.com
Hi Manish, did you get a check the mediatype on the uploaded file, and if
you're having this issue because the wrong type is sent by the browser for
`.msg`?

Mani

unread,
Jun 15, 2020, 10:13:13 PM6/15/20
to Orbeon Forms
Hi Alex - looks like the browser do not recognise the file type. I had to use octet-stream to upload/download the file.

Thanks

Alessandro Vernet

unread,
Jun 16, 2020, 12:27:06 PM6/16/20
to orb...@googlegroups.com
Hi Manish,

Got it, then this is a case where an improvement we've made in 2020.1 to
infer the mediatype based on the extension when the browser doesn't know
about the mediatype for the file. You can find more about it on:

https://doc.orbeon.com/form-runner/component/attachment#mediatype-determination

Patience, 2020.1 should be be released during the summer ;).
Reply all
Reply to author
Forward
0 new messages