简体   繁体   English

如何将加密文件上传到Google驱动器

[英]how to upload encrypted file to google drive

我想将数据库(sqlite)文件上传到Google Drive帐户。但是我不知道如何将文件上传到Google Drive.pls提供一些代码或链接,这可能有助于将文件从内部/外部存储设备上传到Google驾驶。

Since I cannot post a comment I would post this as an answer. 由于我无法发表评论,因此我将其发布为答案。 Hope that it's not against community guidelines. 希望这不违反社区准则。 But can't you just use an intent to ask the user to select Google Drive if installed (if the user wants to upload it to their own drive space,but you've not provided any info on that). 但是,您不能仅凭意图让用户选择是否安装了Google云端硬盘(如果用户想将其上传到自己的硬盘空间中,但您尚未提供任何信息)。

Intent intent=new Intent(Intent.ACTION_SEND).setData(uriToFile).setType(mimeType);
startActivity(intent);

How to make the valid URI; 如何制作有效的URI;

String path=Environment.getExternalStorageDIrectory().getAbsolutePath()+"/"+stringPathToFile;
Uri uri=Uri.fromFile(new File(path));

Use this instead of Uri.parse(String). 使用它代替Uri.parse(String)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM