Home Uploading a large file (>1GB) to grails3
Reply: 0

Uploading a large file (>1GB) to grails3

user770
1#
user770 Published in May 27, 2018, 11:29 pm

Uploading a large file (>1GB) to a grails, I only need to access it via stream, no need to save the entire file to disk or RAM. However how can I access the upload stream? I tried with an Interceptor:

class UploadLargeFileInterceptor {

int order = HIGHEST_PRECEDENCE

UploadLargeFileInterceptor() {
    match(controller:"apiv2", action:"uploadLarge")
}

boolean before() {

    log.error('before')
    log.error(request.getInputStream().text.length() as String)
    true
}

boolean after() {

    log.error('after')
    true
}

void afterView() {
    // no-op
}
}

but stream length is always 0 and in the controller there is a multipart file which I am trying to avoid because it will store the whole file. Any ideas?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303896 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO