Auto download and rename, the data collected using odk collect

Hello @Thalavaipandi,

It's kind of hard to help you because you didn't give us so much to go on here. For starters, are you able to write code? If you are, which language do you often use? I am certain the many power users here will be able to get you on the right path with a little more help.

That said, I'll throw in this to at least help the situation a bit. cURL, used below, is cross platform so it should work regardless. You can have a program or script that obtains the data in the data-treedetails-observations-image column and truncates the part after ?id=
So for the first record in the file you attached, you will need to extract 1jog99LeRijRhpLv0eu3cch8jsok0-Xwc from https://drive.google.com/open?id=1jog99LeRijRhpLv0eu3cch8jsok0-Xwc

The next step is to open up terminal or command prompt and use

curl -L -o [desiredName] "https://drive.google.com/uc?export=download&id=[fileID]"

making sure to replace [desiredName] with the custom name and [fileID] with the string you extracted in the previous step. So to download the first record to your device and renamed to image3.jpg you will need to use

curl -L -o image3.jpg "https://drive.google.com/uc?export=download&id=1jog99LeRijRhpLv0eu3cch8jsok0-Xwc"

For files greater than 40MB though, you may need to consult this post.

2 Likes