![](/img/trans.png)
[英]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.