File upload size

(Erlingur) #1

Hi there

How can I configure the max file upload size? Is that a PushType thing or a Rails thing? Thanks!

(Aaron Russell) #2

Unfortunately it can’t be overridden. The javascript code for the various javascript components is compiled within webpack and their config options are enclosed in ways that we can’t override. Ideally we should have a huge config object attached to the window object, so we can simply add a bit of javascript to override any of these config options.

I’m planning to release a new version this week updating some of the gem dependencies, so if you like I can update the global max size? 10mb is as arbitrary as any other number, so I have no issue doubling or tripling it for now. What do you think? When the new admin UI is done this will be improved and user configurable.

(Erlingur) #3

Ah ok. Yes, in the future it would be great if this was configurable.

Yes, that would actually be great if you could. In my case these are biggish PDF files that they want to upload so 50mb or even 100mb would be great. Is that too much in your opinion?

(Aaron Russell) #4

This is quite a frustrating issue as it should be user configurable… with it being hardcoded it’s always going to be too small or too large for some users.

I have changed the max file size, but only to 35mb, based on transferring a file of that size over a 10Mb connection would take 29 seconds (just under the Heroku timeout limit). This probably doesn’t help you, but some people would argue it should be smaller so whacking it up to 100mb doesn’t feel right either.

As I said above we need a global config object to set and override options on the various javascript libraries in use. That’s something that needs a bit more thought and as there’s work afoot on a new admin UI it kind of makes sense to tackle it then. The release I’m working on today is just a minor bugfix release, but will be out this evening or over the weekend.

(Erlingur) #5

Yeah, agreed. I’m sure as more people start using PushType this will crop up again soon :slight_smile:

Great, thanks! 35mb is already a lot better than 10mb.

Thanks Aaron! As a sidenote, I’ve deployed PushType to production and the people that are using it are very happy with it. It’s a site for a secondary school in Iceland and the users are not super tech savvy but still decent and find PushType very easy to work with!