how do I create a file upload in grails which works with oracle? how do I create a file upload in grails which works with oracle? oracle oracle

how do I create a file upload in grails which works with oracle?


Instead of setting the type to blob try to increase the maxSize constraint:

static constraints = {    rawFile(maxSize: 20 * 1024 * 1024) // 20 MBs    // ...}


If you want to use a Blob field in Oracle then set your domain property to byte[] and set the type to org.hibernate.type.MaterializedBlobType. The MaterializedBlobType handles conversion back and forth between Oracle (presumably other databases, but I've only done this on Oracle) and byte[].

byte[] blobFilestatic mapping = {    blobFile type: org.hibernate.type.MaterializedBlobType}


I'm not sure what you are doing in your controller, try doing it manually to see what happens:

request.fileMap.each { name, file ->    if (!file.empty) {        model.rawFile = file.bytes    }}model.save()