P
P
Pychev Anatoly2018-11-26 16:21:50
PHP
Pychev Anatoly, 2018-11-26 16:21:50

Downloading images from google drive. What is the right way?

Hello.
The task is to upload a large number of images from Google Drive to a WordPress Woocommerce store.
Actually the question is in choosing the solution path:
1. Use google-api-php-client .
++: Everything is done in one language, php.
-- : Run script by cron or from admin panel. Because there are many files, the process will be long. It is necessary to organize a table of processed images, so as not to be repeated in case of an emergency exit or when images are added to the disk and new ones need to be added to the site. Wasting website resources.
2. Use the Google Script Web application, which will produce the following file upon request. Haven't tried this method. The file is supposed to be output via ContentService.createTextOutputpassing as BASE64 or ContentService.downloadAsFile
++: It is up to Google Script to control whether the file was previously uploaded or not.
-- : It is necessary to write in 2 languages, but this is not a problem.
In general, ideally, everything would be done by a google script and only send a post request to a site with a picture. And the site would already process it and connect it to the product. (the article and the names of the pictures are the same)
Tell me which way to go, or maybe there is a way that I don’t see?
Maybe some links?
According to search queries, I revised a lot both in the Russian community and in English
Thank you in advance

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Ivanov, 2018-12-11
@pton

Both methods are comparable and make no difference in the context of the Google infrastructure. These are all Disk services and you pull the Disk API. Which in itself is not a cash cow. Don't expect that if you frequently request images, you won't see an access denied or connection denied. Use Google Cloud Storage. Finally spend $10 a year and get a civilized, fast, reliable and convenient access to network sharing.

G
Greg Popov, 2018-11-26
@Gregpopov

In the context of WP, it is better to use the 1st option.

O
Online store without Php, 2020-04-26
@HEEG

why it is impossible to load via links like https://drive.google.com/uc?export=download&confir...
if you click it will download the image. But if you paste it on the site, it will show.
Here is an example of a store where all images and all data (Google Spreadsheet) are on Google Drive heeg.ru/shop.html?id=1LJKSexFKRh6EpWeDTvgbYNBZhhf-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question