w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

Categories : Javascript

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.

Categories : Java

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.

Categories : Android

Autorun PDF on CD
Following this guide... Have you tried: [autorun] shellexecute=MyPDFfile.pdf This guy seems to be having a similar problem - Autorun.inf on a usb can you get it to run a pdf? The only answer provided says to include a freely distributable PDF viewer exe with the CD/USB

Categories : Windows

Converting com.google.api.services.drive.model.File to java.io.File
No, you it doesn't seem like you can convert from com.google.api.services.drive.model.File to java.io.File. But it should still be possible to generate a multipart-form POST request using your data in Drive. So the com.google.api.services.drive.model.File class is used for storing metadata about the file. It's not storing the file contents. If you want to read the contents of your file into memory, this code snippet from the Drive documentation shows how to do it. Once the file is in memory, you can do whatever you want with it. /** * Download the content of the given file. * * @param service Drive service to use for downloading. * @param file File metadata object whose content to download. * @return String representation of file content. String is returned here * b

Categories : Google App Engine

delete a file from local drive after successful upload to ftp using batch file
You need to redirect the output of the FTP command. Check for a succesful message and act upon it. I can't provide an exact script, because it will depend on the FTP command you actually use, but the idea is like this. echo open Host Name >%temp%ftpin.txt echo user_name >>%temp%ftpin.txt echo password >>%temp%ftpin.txt echo put user_input.csv >>%temp%ftpin.txt echo bye >>%temp%ftpin.txt ftp -n -s:%temp%ftpin.txt >%temp%ftpout.txt for /f "tokens=* skip=9" %%a in (ftpout.txt) do ( if "%%a"=="226 Transfer complete." ( del user_input.csv ) ) EDIT: You will have to adjust your BAT to the actual output of your FTP script. Probably you will need to change the "skip" parameter of the FOR command.

Categories : Batch File

Autorun Ngen.exe on First Run
Is it recommended to autorun ngen.exe on the first run of the app? I have never read or heard any such recommendation, but it is an interesting idea. I say go for it and test whether it works for your situation (which is interesting insofar as your "portable"/"no-installer" requirement). Is there a built in way to do it? There is not a built-in way to run NGen on the first run of an app; but it can be done as the PoC below demonstrates. PoC code The following PoC code incorporates code from a related SO answer. using System; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; namespace SelfNgenPoC { class Program { static void Main(string[] args) { /* * Check whether the app has been NGen'd with code

Categories : C#

What's `rspec/autorun` for?
As far as i understand, you would need rspec/autorun if you want to run specs using "ruby" command. From RSpec docs: Generally, life is simpler if you just use the rspec command. If you must use the ruby command, however, you’ll want to do the following: require 'rspec/autorun'

Categories : Ruby On Rails

How to autorun RSpec in textmate
You can go to http://ruby.railstutorial.org/chapters/static-pages#sec-guard to install Guard 3.6.2 Automated tests with Guard then you can also add http://jam.im/blog/2013/02/11/mac-osx-notifications-with-guard/ Mac OSX Notifications With Guard so you don't have to use growl notification

Categories : Ruby

tideSDK autorun program
Depending on operating system you need to do different things to achieve what you want. For windows you can place the shortcut in Start -> All Programs --> Startup folder to start your application at Startup time. For linux systems you need to modify init scripts.

Categories : Misc

Windows 8 Custom Autorun Flashdrive
This will work to mirror your flash drive to c: on Vista and higher. XP too if you download Robocopy from MS. @echo off robocopy "%~d0" "c:flash-backup" /mir Beware and make sure you make a secondary backup now and then: if your flash drive becomes corrupted and you don't realise it for some time, and have used the flash drive in all your machines, then all your backups will be corrupted too. Backups are too important to leave solely to automated methods.

Categories : Windows

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

Categories : Javascript

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.

Categories : Android

JDeveloper Error : (CMD property not found in autorun.inf)
That link you posted has a more or less working answer. I had the same problem and found that at the same time as this question. I'll post the answer here, along with what I had to do to get it working. The answer: 1. Extract "jdev_suite_121200_win64.exe" file into C:jdev_suite_121200_win64 2. In cmd go to C:jdev_suite_121200_win64Disk1 3. Execute follow command: C:PROGRA~1Javajdk1.6.0_31injava.exe (..your JDK..) -jar install/modules/ora-launcher.jar DISKCNT=1 JRE_COMPONENT=oracle.jdk,oracle.jre This answer, for whatever reason, actually failed every time I tried to install using the Java 7 jdk java.exe, and was incredibly frustrating. However, once I ran it with my Java 6.0_38 jdk java.exe, everything ran fine. The installer will tell you that the check for Java failed because it

Categories : Java

How to autorun collectstatic on local django instance?
You could create a bash script that does this bunch of commads for you. While I have no experience with foreman, you could create a script with content something like: #!/bin/bash sudo killall foreman python manage.py collectstatic foreman start Then add execution rights to it: chmod +x script.sh And execute everything in one command: ./script.sh

Categories : Python

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".

Categories : Javascript

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.

Categories : Google App Engine

Meteor Autorun() not running when accessing collection.property
Found this in the depths of the Meteor.js documentation: "If the initial run of an autorun throws an exception, the computation is automatically stopped and won't be rerun." On the first run of autorun, which is when the page is loaded, the database hasn't been loaded which throws an exception when you try to access room.room_id, and the autorun immediately stops from running again. Fixed by adding: if (room) { console.log(room.room_id); ... }

Categories : Meteor

How do I find out what physical drive a file is on?
Volumes in Windows are generally mapped to drive letters (except on network shares). You can create a volume file device handle on the source and destination using CreateFile() just passing in the drive letter path (ie: \.C:). Use the returned handle with DeviceIoControl(). Compare the physical drives between the source and destination, and you should be good. Discussion explained here: "To obtain the physical drive identifier for a volume, open ..." http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx

Categories : C++

I am trying to save my file on the c drive and im getting an error
If you need to write to a specific path in Windows, you need to use quoted backslashes: File happyFile = new File("c:\mydir\happy.txt"); To make the code generic you can use the path separator and home directory from the system properties.

Categories : Java

Is it possible to drive the @Size "max" value from a properties file?
This is not possible. The constant expression that you provide as a value for the max attribute is added at compile time. There is no way to change the value of an annotation at runtime. Setting it from a properties file you read is therefore not possible What you can do instead is to create and register your own Validator for the your class that has that field. For example, public class MyValidator implements Validator { public void validate(Object target, Errors errors) { MyObject obj = (MyObject) target; int length = getProperties().get("max.size"); if (obj.name.length() > length) { errors.rejectValue("name", "String length is bigger than " + length); } } public boolean supports(Class<?> clazz) { return clazz =

Categories : Spring

Cannot upload .doc file with google drive sdk
When I try to use var_dump($mimeType) for .docx file, the result is : string(71) "application/vnd.openxmlformats-officedocument.wordprocessingml.document" and for .doc file : string(20) ""application/msword"" Based on the results, I found the problem. There is an additional double quote in $mimeType for .doc file. So I try to change my code like this : $data = file_get_contents($filename); $mime = str_replace('"', "", $mimeType); $createdFile = $this->service->files->insert($file, array( 'data' => $data, 'mimeType' => $mime, )); It now works.

Categories : PHP

download file from google drive
Try to use this link format in the first example: https://docs.google.com/uc?export=download&id=0B2P4BoDG6mdejjesiEEFMNHN0cFU more help: http://thebiobucket.blogspot.hu/2011/10/how-to-link-to-google-docs-for-download.html

Categories : Vba

How do I open a file in google drive using its api?
Are you making sure you have an access token before sending the request? And are you using the example JavaScript provided? Authorizing Your App with Google Drive: All requests to the Google Drive API must be authorized by an authenticated user.

Categories : Javascript

google drive sdk upload file
The answer to both the "untitle" and "parent folder" questions is the same. Meta Data. When you POST you should provide a meta data object containing a title:"title" and parents: [{id:"parent_id"}]

Categories : Api

Upload file to Drive and set file name
You need to make a multipart request with metadata and media parts. Use curl_formadd and make sure your request looks like: POST /upload/drive/v2/files?uploadType=multipart HTTP/1.1 Host: www.googleapis.com Authorization: your_auth_token Content-Type: multipart/related; boundary="boundary_tag" --boundary_tag Content-Type: application/json; charset=UTF-8 { "title": "My title" } --boundary_tag Content-Type: image/jpeg data --boundary_tag--

Categories : C++

I need to use XmlDocument object instead read xml file from drive
You could write the XmlDocument to a MemoryStream, and then Deserialize it like you already did. XmlDocument doc = new XmlDocument(); ClassFromXsd obj = null; using (var s = new MemoryStream()) { doc.Save(s); var ser = new XmlSerializer(typeof (ClassFromXsd)); s.Seek(0, SeekOrigin.Begin); obj = (ClassFromXsd)ser.Deserialize(s); }

Categories : C#

Upload file to google drive using api with phonegap
Was there any problem integrating Drive API with Phonegap? Drive API is basically HTTP requests and it can all be done with pure Javascript. Therefore, you can use jQuery AJAX calls for Files.insert(). However, I would recommend you to use Javascript client. Here is an example of OAuth using JS client library. Please try this example with your Phonegap application and ask question again if there is any problem.

Categories : Cordova

Google Drive SDK application to upload file
In your Android application configuration page, select Google APIs (Google Inc.) (API 17) for Compile with. Also, it would work more stable on real phone than virtual device since virtual device doesn't have play store.

Categories : Android

Accessing a file on the server's hard drive
You cannot reach the file that is "above" the wwwroot folder by design. The way to do this is to a) copy the file there, b) setup a symbolic link (if on linux) or c) preferably, move / setup another web root folder. Alternatively, write a server script to dump the file contents.

Categories : Javascript

Pre-allocating drive space for file storage
You can pre-allocate space by writing a large file, but to be honest I wouldn't bother. Performance will be pretty good/ probably better than you need. If you really needed performance, you'd be writing C++/C# and doing RAW I/O. But that's typically only done when writing an RDBMS engine, high-volume media capture or similar.

Categories : Java

Download thumbnail of file from Google Drive
Use File.getThumbnail method to get the thumbnail or File.getIconLink to get the icon link.

Categories : Android

Google drive API upload file exception
You've almost certainly installed mismatched api libraries and/or you're copying example code which refers to an out of date version of the library. The api client libraries have been through several revisions, with many breaking changes along the way. I suggest you clean out all of your libraries and re-install. If you're using eclipse, you can use Add Google APIS to install the latest libraries for you.

Categories : Java

Search contents of a file in google drive
see here : https://developers.google.com/drive/search-parameters and fullText string contains Full text of the file including title, description, and content. in the drive SDK documentation

Categories : Java

How to upload a file to google drive programmatically
You need to check for Google API Java Client Upload to Google Docs This is a sample Android application which uses the google-api-java-client library to demonstrate uploading a file to Google Docs. This app will Perform OAuth2 authorization against Google Docs Create a folder (known as a collection) in Google Docs Upload a file to Google Docs (inside that folder) Update a file on Google Docs Take a QuickStart to Google Drive API

Categories : Javascript

How can I get the UNC path of a file that is on a mapped network drive
You can use the WNetGetConnection() function to convert from a mapped drive letter to the UNC path. I can't help you with .NET sorry (which you should be careful about writing shell extensions using) but in C++, LPCWSTR pszPath = L"M:\"; // mapped drive if (GetDriveType(pszPath) == DRIVE_REMOTE) { // WNetGetConnection needs drive letter WITHOUT trailing backslash wchar_t wchDrive[3] = { pszPath[0], pszPath[1], L'' }; wchar_t wchUNC[MAX_PATH]; DWORD dwLength = _countof(wchUNC); if (WNetGetConnection(wchDrive, wchUNC, &dwLength) == NO_ERROR) { // do something with wchUNC } }

Categories : Networking

Google Drive SDK - Stream audio file
That is simply because you didn't provide your client's access code from header of the download request. When you get downloadUrl, that link is not public link and you should provide same authorization as you did for all other Drive API requests. For example, Object-c code for downloading content from downloadUrl would be like this: + (void)downloadFileContentWithService:(GTLServiceDrive *)service file:(GTLDriveFile *)file completionBlock:(void (^)(NSData *, NSError *))completionBlock { if (file.downloadUrl != nil) { // More information about GTMHTTPFetcher can be found on // http://code.google.com/p/gtm-http-fetcher GTMHTTPFetcher *fetcher = [service.fetcherService fetcherWithURLString:file.downloadUrl]; [

Categories : Iphone

Download image file from Google Drive
The Google Drive SDK documentation shows how to download files with a given path in user's drive: https://developers.google.com/drive/manage-downloads I am sure you can download the images just like any other image file on the internet. Save it to device, make a bitmap out of it, etc.

Categories : Android

Upload file to Google Drive after downloading it from URL
Use UrlFetch Services to get the data from the URL and Drive Services to store this data on Google Drive

Categories : Google Apps Script

How to find default drive of windows using batch file
This is stored in the variable %SystemDrive% echo %SystemDrive% But you probably want to use %SystemRoot% instead which includes the drive and the directory: echo %SystemRoot%

Categories : Batch File



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.