0

Im using grails for my webprojekt.

I had some user-uploads and saved only the binary and the file name in my database. is there any way to restore the files from the saved binaries and get the contenttype of each file? Or are the contenttypes ultimatly lost for me?

  • 1
    possible duplicate of [Getting A File's Mime Type In Java](http://stackoverflow.com/questions/51438/getting-a-files-mime-type-in-java) – Joshua Moore Aug 28 '14 at 15:37

1 Answers1

0

thx. but a night with sleep and i had it.... quit easy.
InputStream is = new ByteArrayInputStream(myBinary); def mt= URLConnection.guessContentTypeFromStream(is);

i thought i need multipartfile or something.