Quantcast
Channel: GalaxyTab – Seite 3 – mynethome.de
Viewing all articles
Browse latest Browse all 90

Micronaut.io: Size Limit for FileUploads

$
0
0

Recently, I’ve been tinkering with Micronaut.io a new application framework which looks quite promising so far.
A good introduction is provided in the documentation, by the examples on GitHub and some nice articles on the web like „Getting Started with Micronaut“ by Jonas Havers.

I had to dig a little bit to find out some things when implementing a file upload. So here are some notes about it, maybe it help ssomeone else ;)

The basic documentation on file uploads provided by the main doc is a good starting point.

Then one might stuble quickly on a fairly well known exception like:

{"_links":{"self":{"href":"/upload","templated":false}},"message":"The received length [1049482] exceeds the maximum content length [1048576]"}

Not straight-forward to find is that the section „body annotations“ provides an answer on what the config setting to adjust this is. Also, it hints for the annotation @Size to provide a value per endpoint which is useful to set different limits in differnt contexts.

For an example how the config is done via an application.yml file can be found in the serverConfiguration paragraph of the documentation.

An important thing to note is when dealing with form based file uploads, you might use enctype="multipart/form-data" and thus need another attribute to set the upload limit. That would be micronaut.server.multipart.maxFileSize. Thus, I ended up with with the config:

micronaut:
    application:
        name: sample-application
    server:
        maxRequestSize: 100MB
        multipart:
          maxFileSize: 100MB

Also, a a final note for this post, let me remind you that as Micronaut is fairly young, it helps to keep an eye on the FAQ and Problems section. I had the problem regarding the startup time, for example, for which the solution is provided there. So easy to solve if you know what to do ;-)


Viewing all articles
Browse latest Browse all 90

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes