Is there a limit to the file size or number of images that can be attached to a survey?

Greetings!
We have been using KoboToolbox with Kobocollect for years, but a problem arose that was something that had not been an issue previously. I am trying to attach images to answer choices, 486 images in all. I have reduced the file size of these images greatly (<200 kb/image), but when I go to upload them using SETTINGS>MEDIA, after adding all 486, it seems only 186 of them have been added. When I refresh the window, it shows that more photos have been added, but never all of the photos.
Is there some sort of file size limit that causing less than all of the images to upload? Previously, we had a difficult time doing it because of poor internet, so we uploaded images a few at a time. That does not work this time. We continue to get the error message "Could not add media*
Please help

Welcome to the community, @qnaservices! Were all the images uploaded through Collect android app or were they also uploaded through Enketo?

Thank you for responding, Kal-Lam!

Some context. We are doing a longitudinal study in which we follow up with the same school children. We take a photo to make it easier to find them at follow up.

Yes, the photos were taken as part of the original survey and uploaded through KoboCollect. Then, I used software to reduce th file size by 75 percent. However, this time when I tried to include them in the latest survey as part of the choices, I can never get more than 186 of the 486 to load onto the server.

What do you suggest?

Alpha Simpson

Managing Director

Q&A, Inc.

+231888762762 | +231777762762

OK, could you outline the exact process so that we could have a closer look at our end?

Hi @qnaservices
The best of my collection is that we have not changed the number of media files one can upload on their project. It would be interesting to understand what is happening while you upload; can you capture the console (Ctrl+Shift+J) as you try uploading additional files beyond the 186, and then we see the error message you get.

Stephane

1 Like

@Kal_Lam and @stephanealoo
Unfortunately, we were on a deadline, and I had to do something to get the work started. First, I will again describe the issue (which may have been exacerbated by internet issues), then I will explain the fix.
1… Upload XLS form onto kobotoolbox.org, with all necessary internal language (media::image column) to incorporate the photos.
2. Go to Settings tab
3. Select ‘Media’
4. Go to attach files, then drag and drop 8-16 files (avg size 80kb) at a time so as to not overwhelm bandwidth
*The first issues arise here.

I have uploaded the error messages and the results of Ctrl+Shift+J
Here was the work around:

  1. No drag and drop, use file upload button instead.
  2. Add files in bulk, say 243 at a time. Then add the next 243
  3. Then add all of them at once

The system is designed to ignore duplicates, so I took advantage if this feature to put them in until all 486 were added.
I hope this helps you to look under the hood. One thing I would suggest is that as one uploads media files, that the page display how many files have been added, so it is easier to determine how many files did not load.
Thank you so much for the help.

Result #2

Result #3

error message 1
Error_adding-media

Error Message 2
Error2_adding-media

Hi @qnaservices, thank you for bringing this to our attention. I’ve been able to reproduce your issue and will get back to you with a way forward on this :+1:

Your suggestion about displaying an upload count is a valid concern and I’ve raised this with the team. As a work-around, you can navigate to:

https://{KF_URL}/api/v2/assets/{ASSET_UID}/files/?file_type=form_media&format=json

The first key in the JSON response will be the count of all your form media files uploaded to that particular asset. If you would like to investigate which files were successfully uploaded, you can see this in the metadata.filename attribute for each item in the results array.

You could create a text file of all these names by doing something like this in your terminal:

curl -s https://{KF_URL}/api/v2/assets/{ASSET_UID}/files/?file_type=form_media&format=json \
-H "Authorization: Token {TOKEN}" \
| jq '.results[].metadata.filename' \
| sed 's/"//g' \
> successful-uploads.txt
1 Like