google drive api - copyfile working only with permission for accessing all files in drive (but jst need to copy) |
According to the documentation, Files.copy() requires at least one of the
following three permissions:
https://www.googleapis.com/auth/drive: "View and manage the files and
documents in your Google Drive" which is the one you want to avoid
https://www.googleapis.com/auth/drive.file: "View and manage Google Drive
files that you have opened or created with this app." Which means you can
freely create any file but only open the files your app created. You can
only copy a file you created, but you cannot copy any other files even if
it is public.
https://www.googleapis.com/auth/drive.appdata: "View and manage its own
configuration data in your Google Drive" Which only lets you control your
application-specific Appdata folder which is probably not what you want.
You can only copy a file with
|
Google drive: Get (root) file and folders with javascript api (get only deleted files on drive) |
Same situation as following question:
google drive api, javascript list files returns nothing
I needed to add to the scope the path 'drive' at authorizing, I had only
drive.file which is intent to create/edit files only. The weird thing is
that the API returns deleted files when you don't have permissions to view
files, I think it's a bug in the API (a serious one).
Post this bug on google drive:
https://productforums.google.com/forum/#!searchin/drive/security$20issue$20permission$20view/drive/pupjKxTz9FU/cUarGIl_Ah0J
|
Error while Retriving files from google drive using drive API. “Calling this from your main thread can lead to deadlock |
You should do any code that could take a long time such as I/O or network
activity on a different thread. In your situation your file retrieval would
be best done within an ASyncTask.
The reason for this warning is because when your code is being executed to
retrieve the file from Drive, the code will block until the file retrieval
has completed, this means that nothing else within the program will be able
to respond, i.e. GUI will not update and input from the user trying to do
stuff with the GUI will not be registered. After a few seconds, if the file
retrieval still isn't complete, then the user will be presented with an ANR
(Application Not Responding) message. This will either give the user the
choice of waiting, if their patient, or most likely force closing your app.
|
Google Drive Javascript API: Detect drive changes - return changes only |
Start with zero on your first call. Within the response is the current
largest change id, which you need to store and use on the next request. In
your code, it will materialise as "resp.largestChangeId".
|
Monitoring changes in Google Drive files for whole domain using Drive API |
Domain-wide delegation simplifies the authentication portion for your app
but you'll still need to auth as each user to get their files and changes.
It may be possible for your app to "grab" all files and make itself (or a
special user) the owner, then you just have one user account to scan but
the "grab" process would still need to run at regular intervals to find new
files created or uploaded by end users.
I believe most apps that need to scan content at this level do it via cron
jobs or AppEngine task queues which make it easy to chunk up the scans
throughout the day. Generally they expect to scan each user account once
every 24 hours or so.
|
[Qt][Linux] List drive or partitions |
You need to use platform specific code. And, please, read the docs!
Returns a list of the root directories on this system.
On Windows this returns a list of QFileInfo objects containing "C:/",
"D:/", etc. On other operating systems, it returns a list containing just
one root directory (i.e. "/").
|
Windows: How to symlink drive to another drive? |
No, mklink isn't going to do it for you. What you need to do is to create
a virtual hard drive (VHD) and copy the client's data to it. (Or modify the
export script, which is the best thing to do.) I used Windows 7 to test my
instructions below.
Start-> run-> diskmgmt.msc (accept all defaults... I'm not doing anything
special below)
From the menu bar select Action -> Create VHD
Choose the location and name the file (which will be the vhd) and specify
the size and click OK.
Right click on the Disk # (underneath will be Unknown and the size and "Not
Initialized"). Select "Initialize Disk" & click OK
Right click on the black bar of the unallocated disk space and select "new
simple volume". A wizard opens up an on the second page it lets you assign
the drive letter. Complete the wizar
|
How do I create & edit a spreadsheet file on google drive using Google Drive APIs only from my Android app? |
You should take a look at Google Spreadsheet API 3.0. It supports JAVA
which you can use in your Android application.
|
Google Drive sdk for android, Getting error 400 Bad Request when uploading file to Google Drive |
You seem to be setting the mime type in the File object, but you need to
set it in the FileContent object.
When you create your file content, you can try passing in the type in
the constructor new FileContent("image/jpeg", localFile); or using the
method setType("image/jpeg"); but in your mediaContent instance, not in
your body instance.
|
How to remove file permissions on linux from an external hard drive? |
To make the partition accessible under Linux run:
sudo chmod -R 777 /media/<drive-name>/
this should make the mac drive accessible for you.
Changing ownership would do about the same, but you need not worry about
it.
|
How can we use Linux from a small storage pen drive? Does it work on micro-controllers also? |
I generally hear that LINUX OS can be downloaded on flash, pen drive
(floppy disk?) etc. How > we can do that?
If you can't get it to work on your own, you can buy a ready made Linux on
a USB drive from
a site like http://www.osdisc.com or http://www.cheapbytes.com
Not all PCs, especially older PCs, can boot from the USB Drive. Even some
newer PCs are beginning to ship with security features that can interfere
with booting code. When it does work, you have to find out the proper way
to boot the USB drive. You might have only a few seconds during reboot to
enter the right key, or it will boot Windows (if Windows is installed).
The key to get to the BIOS Boot Menu might be delete or escape or F10 or
some other key (varies with PC motherboard manufacturer). A message on the
screen
|
Using Subclipse with share drive specifically an office-like share drive |
You should start with the SVN book, chapter 1:
http://svnbook.red-bean.com/en/1.7/svn.basic.html
You need a SVN server and repository. That is what you will "share" with.
All users that want to collaborate on the versions of a file will need to
use a SVN client so that they can checkout and edit files stored in your
repository and commit their changes back.
|
Listing of all folders of Google Drive through IOS Google Drive SDK |
Assuming this code works, there is a problem in the query. Multiple queries
should be combined by and.
query.q = @"mimeType='application/vnd.google-apps.folder' and
trashed=false";
For more examples of sample queries, take a look at Search for Files in
official documentation.
Also, in case this code doesn't work, you want to use Files.list() with
query above. Check the link and there is a sample code for Object-c you
might want to use.
|
JS Google Drive SDK |
If you want a separate app that edits the spreadsheet externally, you can
use Javascript in conjunction with the Spreadsheet API at
https://developers.google.com/google-apps/spreadsheets/
Alternatively you can embed Javascript within your spreadsheet using Apps
Script as described here
https://developers.google.com/apps-script/reference/spreadsheet/
It really depends what you are trying to achieve.
|
Google Drive SDK for OCR |
I just finished making this Google Drive Quickstart example from the
documentation work. The code is outdated and didn't even compile at first.
Once that succeeded I had some other issues when running the app on a
device.
I have listed the changes required to get this working and committed to the
following github project. It's an Eclipse ADT project so feel free to check
out and compare with your code. I've tested with the OCR option enabled and
verified the result.
https://github.com/hanscappelle/more-android-examples/tree/master/DriveQuickstart
The readme file has an overview of all the required changes.
|
Searching a drive with vb.net |
You need recursion here which handles each folder.
EDIT: As requested by the OP, a little example:
Public Sub DirSearch(ByVal sDir As String)
Try
For Each dir as String In Directory.GetDirectories(sDir)
For Each file In Directory.GetFiles(dir, "yourfilename.exe")
lstFilesFound.Items.Add(file)
Next
DirSearch(dir)
Next
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End Sub
Also take a look at the following answers:
Looping through all directory's on the hard drive (VB.NET)
How to handle UnauthorizedAccessException when attempting to add files from
location without permissions (C#)
Also note, if you have enough access rights, you could simplify your code
to this:
Dim di as New D
|
Installing TFS on a non-system drive |
TFS stores it's data in SQL Server. So wherever SQL Server hosts it's data
files (MDF/LDF) is where the TFS data will be located.
Note: You don't have to "install" SQL to your data drive, you just have to
make sure it's configured to place the SQL Server data files there.
If your databases have already been created you can also move the existing
data files using SSMS.
|
Run/drive Excel via own application |
Is it possible to 'drive' excel via a c# application (i.e. select
something from a excel gui dropdown list, press a button and read the
content of particular cells)?
Yes, you can use COM Automation from C#. Create a C# project and add a
reference in the COM section of the dialog. You should reference Microsoft
Excel 14.0 Object Library. This is the Excel 2010 version and if you use
another version you should reference the version you have installed on your
machine.
You can then automate Excel in a similar way as you would do using VBA
except you now are using C#. On MSDN you have Getting Started with VBA in
Excel 2010 that among other things explain how you can use the macro
recorder to create a VBA subroutine from actions you perform in Excel. You
then have to translate the VBA int
|
Where should I put a new Sitecore project on my C drive |
I'd advise you to have a read through this series of articles by Jens
Mikkelsen.
That's also how I've set it up here:
- Install Sitecore in c:inetpubwwwroot
- Create a VS project in c:projectssitecore
I copy the code from my VS project to my Sitecore website using MSBuild.
Regarding your browser question: I usually set up a website in IIS pointing
to c:inetpubwwwroot (or wherever Sitecore is installed). Then add an entry
in my hostfile such as sitecore.local, pointing that to 127.0.0.1.
|
Nodejs Google Drive API |
Yes.
The Node.js API client will detect access token errors and automatically
refresh the token.
You can see this in the source:
var hasAuthError = res.statusCode == 401 || res.statusCode == 403;
// if there is an auth error, refresh the token
// and make the request again
if (!opt_dontForceRefresh && hasAuthError &&
credentials.refresh_token) {
// refresh access token and re-request
that.refreshToken_(credentials.refresh_token, function(err, result) {
if (err) {
opt_callback && opt_callback(err, null, null);
} else {
var tokens = result;
tokens.refresh_token = credentials.refresh_token;
that.credentials = tokens;
that.request(opts, opt_callback, true);
}
});
}
|
Any possible way to re-program a USB drive's microcontroller? |
What I was thinking was if one could reprogram them to say, start an
application upon insertion into a USB port, then it could be useful for a
multitude of applications (such as copying files automatically).
You are mistaken. When you reprogram a USB flash microcontroller, you
cause a program to run inside the USB flash stick. You do NOT cause any
program to run on the computer's main processor. The USB flash stick's
processor only interacts with the main computer by responding to USB
transactions initiated by the USB host controller in the main computer,
which is under the control of the OS.
In effect, your capabilities are limited to changing what kind of USB
device it is reported as (mass storage or imaging or network or ...) and
changing the content of the data returned when t
|
C# Google Drive API References |
You can download the API and it's dependencies via Nuget.org if you want
them precompiled. The Nuget version is only slightly out-of-date however,
if you want the newest version you will have to download the source and
build it.
I'd say go with the Nuget version for simplicity.
Google Drive API on Nuget.org
|
Integrating Google Drive |
Asking for user's username and password is actually a bad practice and most
of the user's won't trust you to give you so easily their Google
credentials, since you can basically do whatever you want with it and not
only accessing the Google Drive but also the Gmail and dozens of other
services. So this is very very bad.
Check all the different approaches that you can use in order to
authenticate your app with Google Services and more specifically you will
have to follow the instructions on how to use the OAuth 2.0 for Installed
Applications.
|
Eject USB drive from Java |
This is something that you will have to do by invoking an auxiliary
application. These applications are not platform independent as you wish.
So, to do that, find out which OS you are on by using
System.getProperty("os.name") and invoke the appropriate command for the
detected OS. Invoking applications is done with
Runtime.getRuntime().exec(). Search for the commands you need for each OS.
|
How can I get the name of the drive on which the Windows is setup? |
Press Windows + R
Type cmd
In the console, type set
You can see the enviroment variables
Probably you'll see something like SystemDrive
So you can simply use System.getenv("SystemDrive")
|
Google Drive SDK Client ID |
On Android, your certificate SHA1 fingerprint and package name together is
unique identifier of your application. As long as these two matches with
information you provided to API console, Drive API will recognize who you
are. You don't need to provide your clientId. In case you don't remember
providing these two information, you should make special clientID for
Android as shown here.
|
why I can't find fuslogvw.exe in my c drive |
Fuslogvw is automatically installed with Visual Studio and with the Windows
SDK.
See relevant for reference MSDN Page
Mine is at C:Program FilesMicrosoft SDKsWindowsv6.0Ain
If you have Visual Studio installed on your computer: On the taskbar,
click Start, click All Programs, click Visual Studio, click Visual
Studio Tools, right-click Visual Studio Command Prompt, and then click
Run as administrator from the shortcut menu.
-or-
If you have the Windows SDK installed on your computer: On the taskbar,
click Start, click All Programs, click the folder for the
Windows SDK, right-click Command Prompt (or CMD Shell), and then click
Run as administrator from the shortcut menu. At the administrator
command prompt, type the following:
fuslowvw
|
Use Google Drive as app backup |
The folder you mention is called Application Data folder, the basics are
explained on https://developers.google.com/drive/appdata
|
Upload to my Google Drive with php |
There are two solutions I can think of.
First, if the attachment is static, I would use save to drive button.
It is easy to integrate without backend changes
Second, File.insert() (link for its quickstart).
You can just follow step by step php quick start tutorial to achieve your
goal
|
Accessing the C: drive on azure VPS with ASP.NET |
Sure. Since you want to access the VM's drive, and you have complete
control over the VM it's easy.
Server
Expose your VM's drive using WebDAV. It's a HTTP API for file sharing.
Here's a WebDAV setup guide for Windows:
http://mythoughtsonit.com/2013/05/deploy-a-file-server-in-the-cloud-webdav-on-windows-azure/
Client
If you are using Windows Azure Websites (very restrictive), your only
option on your ASP.NET site is to add C#/VB code to read/write from the
WebDAV share. Here's some .NET WebDAV clients:
https://github.com/kvdb/WebDAVClient
http://webdavnet.codeplex.com/
http://www.independentsoft.de/webdav/
If you are using a Windows Azure Cloud Project and have a Web Role (more
flexible), on that web role you could make a startup task which maps the
WebDAV as a network drive an
|
Access Google Drive through Web app |
You need to use a service account if you don't wish to have to authenticate
everytime.
You can find the information you need about service accounts/service
account-auth here;
https://developers.google.com/drive/service-accounts
Make sure when doing service account auth that you pass the prn parameter
to make the account pretend to be you (so it can access your Google Drive).
https://developers.google.com/accounts/docs/OAuth2ServiceAccount#formingclaimset
|
Google Drive API downloadUrl 404 in iOS |
Hah, so it seems the devil is in the detail I left out of the question.
When creating the authorizer the scope I was providing is
kGTLAuthScopeDriveFile, which was the default in an example and I forgot
all about it when everything else thus far worked fine. Apparently I need
to use kGTLAuthScopeDrive instead (the differences are explained here)
The logic seems a bit flawed here though, I mean I don't want access to
other files that weren't created with the app, I just want access to a
public file somebody else created with the app...
|
Google Drive API behavior |
When you are accessing Drive using the SDK, you pass an access token
(hidden in a Credential object). That access token is what associates the
API call with a particular Drive account. It is the responsibility of your
app to use the correct access token (Credential). Without seeing your app,
it's nigh on impossible to tell you what you are doing wrong.
One thing to be aware of. You say "GAE running on my gmail id".
That could mean "my appengine application is owned by my gmail id". It
could also mean "I use GAE's authentication mechanism to login to the app".
Neither of these are related to the Google Account access token that you
are using to access Drive. It might be that you've confused the Appengine
Login Id with your Google Accounts ID. They are different. In general, if
you are usi
|
Only 82 kb 0f 3 MB is downloading from Google Drive? |
I don't have a solution, but I have a diagnosis, and the next step. If
multiple files, some long, some short, are fetching 82KB, then double check
that you are fetching the correct URL.
It looks like, when the user chooses a filename you aren't fetching the
correct URL, but something returning 82KB of data, like the directory
listing.
You can check by running the DrEdit sample app from
https://developers.google.com/drive/examples/objectivec and by turning on
GMHTTPFetcher logging, (GMHTTPFetcher is a wrapper for NSURLConnection)
http://code.google.com/p/gtm-http-fetcher/wiki/GTMHTTPFetcherIntroduction#HTTP_Logging
|
Embedding a doc into a doc in Google Drive |
You cannot embed a document into a document, but you can append the
elements of one document to the body of another document. Have a look at
the answer to How can I generate a multipage text document from a single
page template in google-apps-script? for a start.
You should be aware of all the element types, as each has its own handlers
- Henrique's answer deals with the three elements that the current
documentation says can be contained in a body, but you may find the list
isn't exhaustive.
|
Google Drive SDK: MediaUploadProgress - not sure how to use this |
You can retrieve the latest status similar to what I'm attaching below.
media = MediaFileUpload('image.png', mimetype='image/png', chunksize=1000,
resumable=True)
request = drive.files().update(id='fileId', media_body=media)
response = None
while response is None:
status, response = request.next_chunk()
if status:
print status.progress()
|
Android and Google Drive |
Start with Android quickstart:
https://developers.google.com/drive/quickstart-android
There is also a sample Android app:
https://developers.google.com/drive/examples/android
For synchronizing data with appdata folder, here is another sample:
https://github.com/googledrive/appdatapreferences-android
Try these and whenever you are stuck, post exact error to get is resolved.
|
Objective c/c: Detect USB drive via IOKit only on Mac |
The problem lies with the IOObjectRelease() call in your handler function.
You need to hold on to the iterator that you get from the
IOServiceAddMatchingNotification for as long as you want to receive these
notifications. If you remove the release call, the code works.
As for your second question: the call gives a bad access error, because
matchingDict gets released by IOServiceAddMatchingNotification. If you do a
CFRetain(matchingDict) before that call, you can add a second Notification
using the same matching dictionary. (BTW: you should pass
kIOTerminatedNotification instead of kIOFirstMatchNotification if you are
interested in device removal notifications.
|
How to check map network drive connection? |
IWshNetwork_Class appears to be a class in the Windows Script Host Object
Model COM library.
Dim Network As IWshRuntimeLibrary.IWshNetwork_Class
Dim Drives As IWshRuntimeLibrary.IWshCollection_Class
Drives = Network.EnumNetworkDrives
For DriveCounter As Long = 0 To Drives.Count – 1 Step 2
MsgBox(Drives.Item(DriveCounter) & " is mapped to " &
Drives.Item(DriveCounter + 1))
Next
Have a look at this PDF for more information...
|
Methods for tracking changes to hard drive |
For realtime tracking when file or directory changes you can use inotify on
Linux or FileSystemWatcher on Windows. Combine with rsync to get delta.
|