Each time a file is uploaded in a specific Google Drive folder, I would like to create a new entry in my CRM.
Since I'm using PHP, I think I might have to run a cron to check for the new files in Google Drive, then report them into my CRM.
But I was wondering, is there a way to tell Google to run my script each time a file is uploaded into a specific folder, thus avoiding the use of crons?
Thanks in advance.
It seems that Google provides a push notification system.
https://developers.google.com/drive/web/push
I still have to test it, but if there is a solution to my problem I think it's this feature ;-)
Thanks to #AndréSchild for his help.
Related
I have bee looking for a way for my web app users be able to upload files but avoid filling the limited hosting space I have. Google drive sounded like a perfect fit but now i'm stuck at how to use PHP for uploading files to my gdrive using a service account. Any help or advice is greatly appreciated.
Edit:
Was able to upload files using oAuth but I don't want my web app users to upload their files on their own Drive but mine. I think using the service account is the right road to go but i'm still scratching my head on to go about using it.
I'm developing PHP script, using Google drive API
It's work fine, but shows shared files that only opened before through google drive interface...
Same results got with
https://developers.google.com/drive/v3/reference/files/list
Why I don't see new shared files and view only Recent files?
How can I view newest files on Shared with me section?
Thank you in advance.
To debug this, here's what you can do:
Share a file using emailA in the Drive web app to your emailB. Then, log your emailB to Drives list explorer. The file should appear there as I've tested this myself. If it DOESN'T, the problem is not Drive API.
Either you've not properly shared the file in your code implementation or you need to re-run your PHP code.
I am new here and newbie in Google Drive thing. I managed to follow and install Google Drive v3. Now, I am stuck as to how can I make a simple PHP code that will upload a text file to my Google Drive. I need a simple PHP code / guide on how to upload a small text file. Please help.
Thanks in advance.
If you want to know how to upload file, then you can check the DRIVE API documentaion for that.
Here you can find 3 options on how to upload file.
simple upload
multipart upload
resumable upload
Just visit the above link to know more about them.
For the PHP code that you want, then you can check the answer in this SO question.
Just remember that you need to set <YOUR_REGISTERED_REDIRECT_URI> to the document to authenticate it.
For more information or other way to upload file using service account, check this SO question.
If you want to understand the process of file upload on google drive.
There is a repository on GitHub on how to authenticate and upload files on google drive using Google Drive API in PHP. You can give it a try.
https://github.com/SM4991/php-google-drive
I have a PHP-based GAE app that takes file uploads, and uses the special app engine handled upload URLs to have users upload files directly to google cloud storage engine. This works great, but I just noticed that for some reason every file that has ever been uploaded also shows up in Blobstore. This is true even of files that I have already deleted from the storage bucket in question. Furthermore, when I try to delete these files from blobstore, I get a message saying they could not be deleted. How can I delete this? I don't want to be billed for them.. Also how can I prevent this from happening?
Here is an image of the blobs:
This seems like an issue which should be reported in the Public Issue Tracker. If you create an issue there you should see a quick response. It seems anomalous that you shouldn't be able to delete these.
I have many many pdf files around 50GB in my Ebooks folder.
Now i want to upload them in Google docs like Rsync of Linux.
Is it possible to have the script in php or python which uploads all pdf files in Ebooks folder and subfolders to Google docs.
Now the problem is i need to restart computer many times and i want that script should start from where it was left with previous file so that i don't need to manually make selection of files. is it possible
You'd use the Google Documents API to upload them using a simple HTTP POST with the data. Here's an explanation how to upload and convert documents: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDocs
The link will provide you will examples and all you need to do what you were asking for.
To be more precise this is what you are looking for if you want to upload pdf's: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#ResumableUploadPUT
Python Google Documents API guide
PHP Google Documents API guide