Google Picker API - Word Vesion - google-api

I want to use the Google Picker API to allow users to upload MS Word documents from their Google Drive to our system. I have everything working fine in on the client (javascript) but the problem is the URL I get from the Google Picker API (var fileurl = data.docs[0].url -> https://drive.google.com/file/d/[google_file_id]/view?usp=drive_web) doesn't link to an "MS Word" version of the file - it links to a Google Docs version. How can I get the URL link to the actual MS Word version of the file?
Thanks in advance!

Found it thanks to this site https://appsevents.com/blog/2014/04/how-to-bypass-google-drive-viewer-and-create-direct-download-links.html
https://drive.google.com/uc?export=download&id=[FILE-ID]

Related

Site title not appearing in google search results (Laravel)

My site title not appearing in google search results.
How can i fix this?
Google search: https://i.stack.imgur.com/Fv8Oc.png
Site title: https://i.stack.imgur.com/FfJqo.png
Code: https://i.stack.imgur.com/oQqLM.png
When did you make this change? It takes time for Google to change a page title (a few days).
You may take a look at Google documentation.
You can also add your website to Google Search Console and Ask Google to recrawl your URLs.

Display embedded doc / docx / pdf inside HTML using Google APIs

I have a problem to display doc / docx / pdf docs assuming I have an online link to them (i.e. http://my.site.com/files/file_id_123423234)
2 Alternative I know Google provide are 2 following links:
http://docs.google.com/gview?url=[link_to_file]
Example:
http://docs.google.com/gview?url=http://my.site.com/files/file_id_123423234&embedded=true
https://docs.google.com/viewerng/viewer?url=[link_to_file]
Example:
https://docs.google.com/viewerng/viewer?url=http://my.site.com/files/file_id_123423234&embedded=true
Both alternatives not always manage to successfully display the doc ending up the http call with "no preview available":
Can you please provide a solution / alternative?
You just need to make use of the Embedded links. To do this, you have to publish the files on the web as stated in Publish and embed Google Docs, Sheets, Slides & Forms.
File -> Publish to the Web. Get the Embed Link.

Adding image to the GDrive document header

I've got web-application that works with google docs. App is uploading docs to GDrive with convertation and then i need to add image into converted document's header. How can i do this using GDrive API? I can't download full document or some converted formats, so i need to do this on google server. I am using SDK for PHP.
Google Drive API doesn't provide features to manipulate Google Docs files. What you can do is to modify the original file and upload again with conversion switched on. You can also use Google Apps Script. Please check out Document.header-section for more details.

Google Image Search via Upload

The image search API from Google has been depreciated:
https://developers.google.com/image-search/
My question is where can we now get the same data? It says it has moved to the new Custom Search API (https://developers.google.com/custom-search/v1/overview), but I cannot find where to now submit uploaded image data for the search. Can someone please explain or link me the information for this.
Our web app needs to be able to upload the image to google and check via a API where the image has been found.
Also if Google does not allow this is there any substitutes?
Thank you in advance.
you can get search result using direct link for uploaded image.
let direct link be http://i47.tinypic.com/ekepuq.png (to stream image data for search) then Make url as
"http ://images.google.com/searchbyimage?image_url=[diretlink]"
ie " http://images.google.com/searchbyimage?image_url=http://i47.tinypic.com/ekepuq.png " and can get search result for the same image.

How to get the file extension and size of a document in Google Docs?

Currently I am implementing .NET Google API to display Google Docs in my ASP.NET web application and I want to fetch the extension and size of Google Document, I got a way to get the extension by sub-scripting the Title of the Document from last index of "." but in case of spreadsheet it can be possible as it just contains the name of the spreadsheet document.
Please provide your suggestion here!!
Also, it would be better if you can provide source in C#!!
thanks!
You can use the Google Drive API to retrieve documents stored on Google Drive and check their metadata, including fileExtension, fileSize and many others:
https://developers.google.com/drive/v2/reference/files
All methods have .NET samples and there's also a complete ASP.NET MVC application that you canuse to get started:
https://developers.google.com/drive/examples/dotnet

Resources