[英]Retrieve csv attachment file from gmail and place the data in a google spreadsheet
[英]Retrieve the content on file form attachment downloaded from gmail as it is storing in gmail server
我必须从gmail应用程序检索内容的文件名。
我得到内容uri一些类似于
内容://gmail-ls/messages/gaddam40gmail.com/4/attachments/0.1/BEST/false
我正在写这个uri,但是会出错,我需要做什么
window.plugins.webintent.getUri(function(url) {
if(url.startsWith('content://')) {
// url is the url the intent was launched with
//alert(url);
window.FilePath.resolveNativePath(url, function(local)
{ //deferred.resolve('file://'+local)
alert(url);
},function (error)
{
alert(error.message);
}
);
alert("passing");
//var path = converted_url.slice(0, converted_url.lastIndexOf('/') + 1);
//var filename = converted_url.substring(converted_url.lastIndexOf('/') + 1);
//alert(filepath);
}
});
},
window.plugins.webintent.getUri(function(url) {
if(url.startsWith('content://')) {
window.resolveLocalFileSystemURL(url, success, fail);
function success(fileEntry){
alert("present");
fileEntry.file(function(file){
alert("is")
var ft=new FileReader();
ft.onloadend=function(e){
// Do something
}
ft.readAsText(file);
}); }
如果是“ ontent://gmail-ls/myemail@gmail.com/messages/520/attachments/0.1/BEST/false”情况1,则此方法有效
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.