简体   繁体   English

Android ODK-如何在文件服务器中存储图像?

[英]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.

相关问题 如何在服务器上存储图像,以便可以将带有 id 的图像路径作为映射存储在属性文件中,以便我们可以根据 id 获取图像 - how to store images on server so that image path with id can be store in a property file as map so that we can get images based on id 如何在Android中使用PHP将图像存储到数据库中? - How to store images into database using php in android? 在 Android Studio 上构建 ODK 1.16.4 失败 - Building ODK 1.16.4 failing on Android Studio 如何从服务器下载pdf文件,将其存储在sdcard中,并通过android中的intent查看? - how to download pdf file from server , store it in sdcard and view through intent in android? Android-SQLiteOpenHelper-如何将图像直接存储到数据库 - Android - SQLiteOpenHelper- how to store images directly to database 如何在 Android 应用程序编程中从数据库中存储和检索图像 - How to store and retrieve images from database in Android app programming 如何将图像从SD卡中的sdcard存储到Android中的数据库? - How to store images from sdcard in avd to database in android? 如何将图像/文件上传到 Tomcat 服务器 - How to upload images/file to Tomcat server Android Java与Rect相交的碰撞(使用Ouya ODK) - Android java collisions with Rect intersects (using Ouya ODK) 在哪里存储Android应用程序的图像? - Where to store images for android app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM