1

I am developing the Data Collection Application using ODK Framework in Android. I just set up the MySQL server in my localhost and data is storing perfectly in MySQL Database. But the images are storing in binary Format. I want to store the images in image format(.jpg) in local directory. How can i acheive this? I searched and didnt found appropriate solution. Can anyone please help the way how to store the images in localhost in image format only by providing links...

Avadhani Y
  • 7,566
  • 19
  • 63
  • 90

2 Answers2

0

ODK Aggregate stores the images in the database so that aggregate can scale. Currently, there is no option of saving the images in a file system. Your best option is once all the data has been loaded onto the server, write a small script to download the images and save them.

You can use cURL as an option for downloading the images.

In ODK Aggregate there is an option to allow anonymous download of images, ensure that this option is checked.

My apologies no silver bullet link for your answer.

tver3305
  • 8,224
  • 2
  • 21
  • 23
0

I'm doing this with a python script. Here is a sample:

#!/usr/bin/python
import urllib
imageLink = "https://odkworkspace.appspot.com/view/binaryData?blobKey=BlahBlahBlah..."
outputFile = "c:/temp/test.jpg"
urllib.urlretrieve(imageLink, outputFile)

As another user mentioned, be sure that in ODK Aggregate you check the option to allow anonymous download of images.

skihansen
  • 83
  • 1
  • 2
  • 8