kefirfromperm / grails-asynchronous-mail

The Grails Asynchronous Mail plugin
http://grails.org/plugin/asynchronous-mail
21 stars 36 forks source link

Actually allowing 30MB data to be stored #88

Open sagrawal31 opened 5 years ago

sagrawal31 commented 5 years ago

AsynchronousMailAttachment domain adds a maxLength validation of 30MB but according to this SO answer https://stackoverflow.com/questions/3503841/jpa-mysql-blob-returns-data-too-long, the default type of byte[] content is BLOB hence only 65,535 bytes (64 kb) is allowed. This PR changing the datatype to LONGBLOB to allow saving at least 30MB of file.

sagrawal31 commented 4 years ago

Any update here?

xpusostomos commented 3 years ago

The trouble with this patch is its mysql specific. The code should be changed to BLOB, but if anything this is a bug in mysql that it insists on departing from other databases in having different blobs.

sagrawal31 commented 3 years ago

Your point makes sense @xpusostomos but if I consider MongoDB as "other databases", there is no need to even specifying a length as the database doesn't support any kind of such validation.