Reduce file size

Hi!

For the “File” question type, the limit for each file is 10 MB. Is it possible to configure the question to reduce the accepted file size?

Thanks

Short answer: no.

Unfortunately, there is no max-pixels equivalent for Files type questions, with which to control the size of size of the file permitted. About the best you could probably do here would be to perhaps set some HTML headers - eg X-OpenRosa-Accept-Content-Length - on your own server to tell the client the maximum permitted POST size for submissions; this would consequently dictate the maximum file size. However, configuring this would require you to be running your own Kobo server.

Might be great to get this option inside XLSForm (or on project configuration level), please?

:+1: This would most likely need to be done by introducing a new XLSForm parameter, much like the existing max-pixels but specifically for (maximum) file size.

Although setting a custom HTML would probably prevent uploading files that are too big, this would also prevent uploading any attachments that exceed this size, including photos, background audio, … And by this time its rather too late - the user has already picked the file to add. Whereas, with an explicit form parameter, the user would be prevented from trying to import it into the form in the first place and given a warning how big file are allowed. And this could be customized per (file) question.

Again, no such parameter exists today, so this would be a new XLSForm spec feature.

Thanks! Do you see a way/channel to post it for XLSForm spec (parameter) development, please?

Any changes to the XLSForm spec and pyxform will involve GetODK, so proposing something on their Ideas Forum might be a good place to start. The GetODK dev team would also likely be heavily involved in the upstream changes necessary in Collect; we’d be responsible for Enketo.

1 Like