configuring mime types for URLConnect

5 views
Skip to first unread message

Jose Blanco

unread,
May 20, 2019, 10:59:48 AM5/20/19
to DSpace Technical Support
I found this post:

https://stackoverflow.com/questions/4212861/what-is-a-correct-mime-type-for-docx-pptx-etc

And there is something in here that says I can do this:

System.setProperty("content.types.user.table","<path-to-file>");

So that in when this line of code is executed:



I will get the right mime type ( that's my hope ), so I changed my code to look like this:

        System.setProperty("content.types.user.table","path_to_mimetype_file/mimetypes.txt");
        return URLConnection.guessContentTypeFromName(name);

But it does not seem to be working.  Perhaps I have to set the property somewhere else? Any ideas?

Thank you!
-Jose
Reply all
Reply to author
Forward
0 new messages