[英]Android ODK - How to store images in File server?
I am developing the Data Collection Application using ODK Framework
in Android. 我正在使用Android中的
ODK Framework
开发数据收集应用程序。 I just set up the MySQL
server in my localhost and data is storing perfectly in MySQL
Database. 我只是在本地主机中设置
MySQL
服务器,并且数据完美存储在MySQL
数据库中。 But the images are storing in binary Format. 但是图像以二进制格式存储。 I want to store the images in image format(.jpg) in local directory.
我想将图像以图像格式(.jpg)存储在本地目录中。 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...
任何人都可以通过仅提供链接来帮助如何以图像格式将本地图像存储在本地主机中的方式...
ODK Aggregate
stores the images in the database so that aggregate can scale. ODK Aggregate
将图像存储在数据库中,以便可以缩放聚合。 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. 您可以使用cURL作为下载图像的选项。
In ODK Aggregate
there is an option to allow anonymous download of images, ensure that this option is checked. 在
ODK Aggregate
有一个选项允许匿名下载图像,请确保选中此选项。
My apologies no silver bullet link for your answer. 抱歉,您的答案没有银弹链接。
I'm doing this with a python script. 我正在用python脚本执行此操作。 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. 如另一位用户所述,请确保在ODK Aggregate中选中了允许匿名下载图像的选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.