How to store a file in the database with Grails

前端 未结 5 821
鱼传尺愫
鱼传尺愫 2021-01-12 23:55

I need to store a file in the database using Grails. So, do you know how I can do that? Which data type should I use in the domain class (byte[] might be a solution)?

5条回答
  •  终归单人心
    2021-01-13 00:11

    alternatively, store the file on disk, and store the path to it in the database. it is generally faster to access that file on disk than in a db. but of course, that really just depends on your needs in the app. But be aware of this alternative.

提交回复
热议问题