【发布时间】:2014-12-09 10:16:46
【问题描述】:
我可以在我的 android 应用程序中拍照,我也可以得到它的路径。现在单击该图片后,我创建了一个名为“上传图像”的按钮,单击该按钮应将该图像作为 BLOB 对象上传到在线托管的外部数据库中。
我无法做到这一点。任何人都可以在这方面帮助我。
这是我获取要上传的图片路径的代码:
String filePath =
Environment.getExternalStorageDirectory() +"/your_image_name.jpeg";
File file = new File(filePath);
Uri output = Uri.fromFile(file);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, output);
【问题讨论】: