w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Google Drive: read-only without authorisation on external site
It is be possible for a third party app to authorize requests without an access token. You can make requests from an allowed referrer/IP with an API key. https://developers.google.com/console/help/#generatingdevkeys Then, you should be allowed to GET the following public file: GET https://www.googleapis.com/drive/v2/files/1T_fVTiyyBVnfYKd_3gZzVfxqU5NbOhIlEG0nyReYh9w?key=[yourKey]

Categories : File

how to sync files from mysql hosting site to google drive
There's no direct way of synchronizing your local data with Drive. However, you can pseudo-sync with little load on your server by using Changes. Basically, you can get list of file changes since the time you specify. If I were you, I make a cron job of checking file changes from Drive and Files.get specific files that have changed.

Categories : Mysql

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

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

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

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.

Categories : Objective C

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

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

View loads offline, but NOT in the live site
OMG... so stupid. 'filename' => 'Minifyhtml.php', in hooks.php had to be changed to 'filename' => 'MinifyHtml.php' (capital H) - not sure why this worked locally, though... :-S

Categories : PHP

Auto play after site fully loads
You'll probably need to use this: http://developer.vimeo.com/player/js-api And you'll probably need to put your code in the window.onload event in order to ensure that the entire page loads before it begins playing.

Categories : Javascript

Site home page loads slowly
Implementing lazyload would definitely decrease load time http://www.appelsiini.net/projects/lazyload Edit: http://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fx-tech.am%2F I know it doesn't always gives the best ideas but enabling gzip and Caching the images using localStorage if they are not frequently updated would also help.

Categories : Javascript

Creating a virtual host using webmin loads default site
I have found that mixing 'Any' with a specific port doesn't play nicely for some reason. Try updating the vhost settings to: Address: Any Port: Any Document Root: /var/www/sites/testsite Server Name: testsite.com When doing so, ensure that you empty any boxes that were filled in as part of you selecting a specific port. Also, just as a side note, get used to setting your sites to not allow directory indexing, unless of course specifically required. So in the Actual Directives Set: Options -Indexes This will stop people digging around in your site. If of course you need to allow someone to view a directory, you can add permission to do so on a folder by folder basis using .htaccess

Categories : Apache

Wordpress site loads slowly - slow server response time?
You need a complete PageSpeed overhaul and are you on cheap cloud hosting? Cuz your actual .com is taking over 2 seconds to load on its own without files. Install w3 total cache and see how it does after activation vs without.

Categories : Wordpress

Google Drive Service Account Access on Google App Engine to Impersonate Users
I do not understand the user part of your code, bacause you use a Google App Engine project user account. See this doc on how to use and find this account. You can also fnd this account using : from google.appengine.api import app_identity logging.info('service account : ' + app_identity.get_service_account_name()) Make sure you have given this project user account access to your drive file or folder! My code looks like this : def createDriveService(): SCOPE = 'https://www.googleapis.com/auth/drive' API_KEY = 'AIzaSyB9UkK4OH5Z_E4v3Qp6bay6QEgGpzou3bc' # GAE credentials = AppAssertionCredentials(scope=SCOPE) logging.info('using service account : ' + app_identity.get_service_account_name()) http = credentials.authorize(httplib2.Http()) return build('drive',

Categories : Python

Trying to do a simple google drive API test using google's dot net library and service account
As it is a service account I don't believe it has its own 'Google Drive', service accounts exist to act on behalf of a user. To 'impersonate' the user whose files you wish to list, you need to pass a prn parameter when you generate the access token; Details can be found here if you scroll down to 'Additional Claims'; https://developers.google.com/accounts/docs/OAuth2ServiceAccount#formingclaimset It appears as though you can set the user via this; var _client = new AssertionFlowClient(GoogleAuthenticationServer.Description, certificate) { ServiceAccountId = SERVICE_ACCOUNT_EMAIL, Scope = DriveService.Scopes.Drive.GetStringValue(), ServiceAccountUser = "Name@Company.com" }; If you wish to log the HTTP interactions, I have f

Categories : Misc

com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example
Since version 1.11, jackson library has been moved out to separate jar to provide developers better choice of versions of each library. Please check readme.html of zip file you downloaded from google-api-java-client and you can check which specific jar file you want to include in your project.

Categories : Java

Can I remove Powered By Google Drive Footer on embedded Google Form?
If you're sure that the form is finished, then the only way that I've found to remove the footer is to go to the "live form" view, view source code in the browser, copy and paste into your web-page and remove the ss-footer from the HTML. The only drawback is that you have to repeat the process every time you alter the form. Still, it gets rid of the footer!

Categories : Javascript

Is it possible to Use Google Apps Script to check condition in Google Drive Forms?
Google Forms does not support client-side validation like that, at this time. Deploying an Apps Script as a web app would allow you to do it, but you have to create all of the formatting and functionality yourself. The recent inclusion of data validation functions in Apps Script in conjunction with Google Forms supporting some scripting access means that we could see something along these lines in the future. Would certainly go a long way toward making Google Forms more useful.

Categories : Google Apps Script

How can I do a copy of my spreadsheet into specifc folder in google drive using Google Script
Use DriveApp ... get the file using getFileById(id) then use makeCopy(name) then Use DocsList ... get the file using getFileById(id) then use addToFolder(folder) I don't think there is an addtofolder in DriveApp and the file objects in DocsList and DriveApp are not the same

Categories : Google Apps Script

Upload text file to Google Drive with Google Apps Script
To do a file upload, you cannot use a server handler. You must use a FormPanel and a Submit button. See the FileUpload widget's documentation.

Categories : Javascript

Google Realtime API - creating and removing shortcut file in Google Drive
From an API perspective, the realtime documents are designed to be persistent storage. The files are long lived, and there is there is no need to ever recreate them or store data elsewhere. If you want to copy data elsewhere, how and when to do that sounds like a design decision you need to make given whatever makes sense for your app.

Categories : Misc

How to edit the document after uploading it on google drive using Google Apps Script
Currently, when you upload a document/spreadsheet using Apps Script, it is uploaded in the same format i.e. it is not converted to Google Docs format. There is an open issue asking for this feature. You can star the issue to register your interest.

Categories : Google Apps Script

Google Drive resumable upload has suddenly stopped working for Google Apps Marketplace App
I have experienced a similar problem. See POST method for resumable media link stopped working The solution we found was not related to the key and key secret. We just switched from an HTTP POST method to a PUT method.

Categories : Google App Engine

Using Google Drive API with service account in Google Apps Engine python project with local debugging
Yes - you can use SignedJwtAssertionCredentials to connect to Google Services. I wrote code which do that at one time and it work great. Using that class is one problem. On GAE is provided PyCrypto library like you wrote but on local you must install it manually. GAE have his own changed version of this library so they didn't provide her source code. Second problem with that library is that she is compiled for specified machine which will use her. If you look in source code of that class you will see that she needs some dependencies to work. If they didn't meet the requirements of that class she will be not accessible from outside code. About problems with import in old and new dev_server i can't write anything because i don't know anything about that.

Categories : Google App Engine

Prevent Google OAuth 2.0 redirection for Google Drive API Integration
We currently offer an alternative flow for installed apps that doesn't redirect back to an app but outputs the exchange code. In order to be sure that user is explicitly giving permissions to your application, we need to intercept the flow for a user action. If there are no end users involved in your use case, you may like to take a look at the service accounts: https://developers.google.com/accounts/docs/OAuth2ServiceAccount Service accounts also provide impersonation for Google Apps domains.

Categories : PHP

Activating Triggers in Google Spreadsheet Scripts with Google Drive SDK
Unfortunately, no. You cannot do meta programming with Apps Script. Based on the answer to this question, I wrote a simple function to try meta programming function meta(){ var mime = 'application/vnd.google-apps.script'; DocsList.createFile('MetaScript','function test(){}', mime); } It throws up an error saying Invalid mime type

Categories : Google Apps Script

import google spreadsheet to site page and apply site styles to a table tag
My guess was right, this code working — spreadsheet inserting «one in one» and can apply different style: <script> $(document).ready(function() { $('#result').load('-google spreadsheet html import link- #tblMain'); }); </script> All much easier than I expected:)

Categories : Jquery

How can i create a big file in google drive with google app script?
DriveApp.createFile() includes a note that it... Throws an exception if content is larger than 10MB. I expect that this limitation also affects DocsList.createFile() and DocsList.replace(). You might have better results by avoiding the need to handle the entire contents of docTotal. Use File.append() to add the content of each file: ... var str = docPartes.getContentAsString(); Logger.log("UNE LA CADENA"); docTotal.append(str); ...

Categories : Google Apps Script

How can I share a created google maps in my site to another site
That's a pretty open question. Before all, you and your friend should use the same app or at least agree on certain comventions. For example - the map will be a json with properties such as latn lng and zoom. - Another properties should yield strings, integers, floats, arrays and objects - among objects, there could be some mcarrays, circles, polygons, etc. All of them have a map property that would throw a circular reference if you try to stringify the map. There are a lot of other comventions to make in order to be able to flatten the map to make it stringifiable, and on the other side, the equivalent to rebuild the map.

Categories : Jquery

Google Drive API Authorizing with Google + Sign in
These are the steps ... Call the auth URL with your app/client ID and the scopes you require. Include the "email" scope. Google will walk the user through login the and (if the first time through) authorisation dialogues Eventually the browser will redirect back to your oauthcallback url, and pass you an auth code Call google to convert the auth code to a refresh token. This will also return the user's google ID and an access token. Store the user ID in your session so you can identify the user subsequently Persist the refresh token alongside the google user id in a database On subsequent visits... If you have the google user id in the your session, you can retrieve the refresh token from your database and use it to generate access tokens as you need them. If you do NOT have the goog

Categories : PHP

Getting unstyled text using QueryPath in PHP
Can you have a look to this example http://jsfiddle.net/Pedro3M/mujtk/ I made like you said using the alt attribute, if you confirm if this is always unique $("img[alt='Location']").parent().parent().text();

Categories : PHP

If user dosen't have Google Drive authority, Google Apps Script couldn't get active user email with "Session.getActiveUser().getEmail()"
It depends on who has access to your app - is it you alone, anyone or anyone, including anonymous. If it is set to anyone or anyone, including anonymous, have you logged in to your gmail account when you visit the google site.

Categories : Google Apps Script

JavaScript UI, requirejs and the Flash Of Unstyled Content
As a follow-up example to external CSS blocking rendering. The rendering of following page will be blocked (in Chrome and FF that I have tested) by the slow external style sheet. <!doctype html> <html> <head> <style>body { background: white; }</style> <link rel="stylesheet" type="text/css" href="http://deelay.me/0/http://rawgithub.com/gitgrimbo/6487200/raw/red.css"> <link rel="stylesheet" type="text/css" href="http://deelay.me/5000/http://rawgithub.com/gitgrimbo/6487200/raw/blue.css"> </head> <body> <h1>Top header</h1> <script>console.log(new Date()); document.write(new Date());</script> <h1>Bottom header</h1> </body> </html> But if you move the two <lin

Categories : Javascript

unordered is not removing the style on using class unstyled
Bootstrap 3+ As of Bootstrap 3, you'd use the list-unstyled class to achieve this. Unstyled - Remove the default list-style and left-margin on list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well. Example: <ul class="list-unstyled"> <li>...</li> </ul> Bootstrap 2 If still using Bootstrap 2, you'd use the unstyled class. Unstyled - Remove the default list-style and left padding on list items (immediate children only). Example: <ul class="unstyled"> <li>...</li> </ul>

Categories : HTML

Marker on google map are not shown after map loads
You have to use marker.setMap(map) I have a nice example on github

Categories : Javascript

Google Earth: How to show a location in google earth after the page loads
You have either to pass the city to the geocoder in the code or to get the latitude/longitude before and insert it in the code. -1. First option The example use Google Maps v.2 API, while now you have available v.3 here: https://developers.google.com/maps/documentation/javascript/geocoding var address = "Los Angeles"; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { point = results[0].geometry.location; alert(point);//this is to see the lat long values var lookAt = ge.createLookAt(''); lookAt.set(point.y, point.x, 10, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 60, 20000); ge.getView().setAbstractView(lookAt); } else { alert("Geocode was not successful for the following reason: " + status);

Categories : Google Maps

is it possible to create a google form that posts directily to a google site page?
This is somewhat possible in a round-about kind of way, but not in a direct way. I've been working on this a little myself. The workflow is Form posts to spreadsheet Spreadsheet is set to publish results via ATOM or RSS feed Retrieve data from spreadsheet using Google Feeds API / JavaScript Dynamically construct a simple webpage

Categories : Misc

Google-maps loads different location from marker
Try and load your variables to make the code look like <html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content=text/html; charset=utf-8 /><body topmargin=0 leftmargin=0 ><iframe width=574 height=275 frameborder=0 scrolling=no marginheight=0 marginwidth=0 src=https://maps.google.com/maps?hl=en&amp;ie=UTF8&amp;ll=" & GLLat & "," & GLLong & "&amp;spn=0.819443,1.454315&amp;t=h&amp;z=18&amp;output=embed></iframe></body></html> Make sure scrolling=no and z=18, z is the zoom where it initially starts out at You will have to piece your variables together yourself :P hope this helps

Categories : Vb.Net



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