Media uploads not working in and self-hosted


file uploads to a form are unavailable in the view and edit table data views. They do seem to show up in the export.

Kobotoolbox .org live site

documents appear to be saved…

self-hosted 2.021.24

Steps to Reproduce

  1. upload multiple different or same files, ensuring <1MB for simplicity.
  2. Check Data table view, edit or open submission record
  3. intermittent error on which documents appear to be available or not

Expected behavior

Expect to be able to download or view media files from within the submission view/edit screen.

Actual behavior

see screenshots above.

Additional and unsure if related: when editing media files in a submission (not sure when this would be necessary, but someone tried), those new files do not appear in the media export. Eg, replacing a file in an existing submission record with a new file, only original file shows in export. the new file name shows in submission edit view, but “cannot be retrieved” and does not appear to be saved/uploaded/stored.

Additional details

This is happening with our self-hosted version and
We are currently using 2.021.24

@tolexy, seems like you are editing the submissions. So a quick question before we dive into this, are you trying to edit the submissions as an admin user or as a shared user?

well, editing OR viewing. For some staff, the easiest way to access requested documents is through the view page, but often says the files are not retrievable. Some users would use the edit link to access the files as well, but wouldnt actually edit the submission itself.

I impersonated the owner of the form for my tests. The form was not private so being logged in as the owner would’nt have an effect I dont think.

I also tried to recreate (clone, upload new XLS, replace, etc) the forms as a shared user (myself) that is also a site admin.

On I created a fresh account and created a form with 4-5 file upload fields. Same problem as there as well where the files show as “cannot be found”

So is this an issue with the pdf file only?

No, not only PDF, it is intermittent with any file type. Even checking between edit and open screens on the data tab, there is inconsistency with that result. The two screenshots below are from kobotoolbox .org, not self-hosted.

OK as a quick check would you mind removing the spaces from the filename and then try it again. i.e. if you are using pct Diff clacs-11_17_59.xlsx try renaming the file to pct_Diff_clacs-11_17_59.xlsx. When looking at your screenshots I observe that this could be the issue. However, kindly please confirm.

Ok, so…it appears that this time all the files show up when clicking “Open” from data table. This is the intermittent issue that randomly shows all files as retrieved or not.

When clicking “View” or “Edit” from the first screenshot, it does at least for now appear that files with spaces are the ones not coming through.

Additional test:

1 Like

Hi @tolexy, this is a known Enketo Express issue and has a fix that will be included in the next upgrade:


thanks @Josh. Does that issue somehow include the usage of the “Open” and “Edit” buttons on the data table?

It seems like this view is not enketo related, but not sure how these files are accessed in this screen, havent dug in to that bit of code…

Hi @tolexy, that’s a good catch. The Enketo Express issue I linked to shouldn’t affect the modal within the KoBo UI but it will affect the Enketo views. There was this fix a few months ago for filenames with spaces, but I see that it still breaks if there are parentheses, ampersands, etc. in the filename. I’ll create an issue for this.

1 Like

You can track the issue here: