Subject: | Unable to access the google drive |
Date: | Thu, 21 Nov 2013 11:24:44 +0000 |
To: | "bug-Net-Google-Drive-Simple [...] rt.cpan.org" <bug-Net-Google-Drive-Simple [...] rt.cpan.org> |
From: | Thamizharasan G <ThamizharasanG [...] sulekha.net> |
Hi,
I need to download a file from google drive. I try but its thorough "Attribute (scope) is required at Google_Drive.pl line 4 " Error.
Here is my code. Let me know how to solve this problem.
Google_Drive.pl:
use strict;
use Net::GoogleDrive;
my $gdrive = Net::GoogleDrive->new();
my $AccessKey='AIzaSyDSxB5bnXyn3TOPB9v8ja-lIcaKiJ6ByBw';
my $code=$AccessKey;
$gdrive->token($code);
my $files = $gdrive->files();
foreach my $f (@{ $files->{items} }) {
if ($f->{downloadUrl}) {
open(my $fh, ">", "file.dl") or die("file.dl: $!\n");
print($fh $gdrive->downloadUrl($f));
close($fh);
}
}
Regards,
Thamizharasan G.
[file:///C:/Users/ThamizharasanG/Desktop/Untitled.png]
[http://classifieds.sulekha.com/marketing/outlook/week3.jpg]<http://property.sulekha.com/?utm_source=outlook&utm_medium=banner&utm_campaign=ipadimage>
(c) 2012 Copyright Sulekha.com | Privacy Policy<http://www.sulekha.com/collateral/privacy.aspx?utm_source=outlook&utm_content=footer> | Terms of Service<http://www.sulekha.com/collateral/privacy.aspx?utm_source=outlook&utm_content=footer> | All Rights Reserved. [http://classifieds.sulekha.com/marketing/outlook/ftgi.jpg]