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.
Related
I've been spending few days trying to figure out how to set aws s3 as external storage for Resourcespace. and i've been getting more confused with the this app.
I'm using the opensource version and trying to customize it to my needs.
I've been through the web app's lengthy documentation but couldn't find anything about setting storage (like other web apps out there) However, I found a feature called syncdir where it sets an alternative external storage (for backup) but not as an external storage, as from the documentation, it doesent seem to have a direct method to specify storage/integrate s3 with it.
I've tried the following:
I've tried using aws s3 integration and how to integrate to any php website, by changing storing directory of 'storagedir' and directory of 'syncdir' in config.default file (i added the require s3 autoload file and added aws keys in config file), but it's not working, site is still storing locally
Note: I've integrated aws s3 before with Laravel 5.7 & Codeigniter 3 frameworks successfully.
I tried adding the require aws-autoload into the file where uploading functions is, and tried to look for the code responsible to upload, but code seems confusing to me where the upload functionality is (its not a php funtion where $_FILES receives your upload.
Changed place of require aws-autoload into include/general.php, but no luck.
Followed up with some forums on the matter like:
using external storage
Amazon S3 integration
I'm assuming that using the config file (to store AWS credentials and storage set to s3 bucket url), i include the aws-autoload in general/upload file, and it would automatically understand where it should upload, but no error or bug is reporting to address it.
But most of what i found is related to the paid version of the DAM system where it seems to be already set up on amazon.
Please advise, Any help is appreciated.
I'm using Wamp on Winddows 10 PC btw
Check this discussion out, it might help you :
https://groups.google.com/forum/#!topic/resourcespace/JT833klfwjc
It look like it is still a work in progress, so you may see the WIP code,
You will find links to code in the mentioned link.
How to upload a file to Google Drive using the API by a url(Remote Upload)? I read the doc and I did not find any option like DropBox where save_url() can be used to remote upload.
But, there are a lot of sites which allows remote upload to Google Drive, so it must be possible.
You may refer with this tutorial on how to directly upload files from the web to Google Drive without saving them completely on the server before. This is useful to upload files, which are bigger than the storage available on the server.
How to use it:
Rename "credentials/oauth-credentials_EXAMPLE.json" to "credentials/oauth-credentials.json"
Download your oauth2 credentials in the google developer console and copy it in it
Call the "index.php" from the console ("php index.php")
Follow the messages in the console window
Create pull requests to help with the development
Hope this helps!
Just as a side project I want to be able to do an online file storage system. Thinking about some of the details and plans I want, I thought of the Google and One Drive Folders.
My question is how do they get folders on your pc that you can use to upload? Its seems like mapping a network drive but to a server or something.
I don't want an API necessarily. I would love to know how they do it and if could get pointed in the right direction as how to do this myself.
Thanks!
What I realized after posting this, is that there must be a program that kind of runs in the background. When a new file is recognized in the folder, it FTP the new files to the server.
Am I on the right track?
Also I forgot to post the screenshot of the folders I am talking about. Sorry!
Both of these services have a couple of fundimental features
the ability to upload and download content on a remote file system
a method to determine what changes have been made on that remote file system
a method to determine what changes have been made on the local file system
a method to manage synchronising changes between the remote and local file systems
For the OneDrive service, there is an API which enables programs to upload and download content #1, it also has a delta API that makes #2 straight forward.
Then for the OneDrive desktop client, it has filesystem watchers that get notified whenever files on the local system change for #3. Then finally this OneDrive desktop client has logic to determine the priority of changes and how to manage conflicts between the file system and the remote file store #4.
I am working to create a script that scans our company Google Drive folders and copies any new files into a Repository directory on my server.
So far I can connect to GDrive, read all files, edit files, but I am unable to download via PHP. copy() file_get_contents() file_put_contents() etc. Are not working.
I imagine the solution is to use Google Apps Script to download and copy the file to my server directory, but I do not see the correct class.methods in the documentation.
How can I copy a GDrive file to my server using Google Apps Script?
You could run some code through Google Apps Script to upload the files to your server. In that case you need to use UrlFetchApp.fetch, which despite its name can also do an HTTP POST with arbitrary data. There is an example for uploading files in the API documentation.
https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app
So far, I've built a PHP script that downloads to a remote server of mine a file from Internet, provinding its URL (I've used this piece of code to download to the server).
Now I would like to upload the downloaded file on Google Drive using its API.
My question is: Is there a way to download the file directly to Google Drive, without using the server? Or I am forced to download the file first to the server and then upload it to Google Drive?
Thank you
I doubt if you can 'make' google drive get file from an external location...
However you do have an option to create a shortcut to the external file, if that suits you.
Also, If you wish continue direct upload you may refer this.
As far as I know the API doesn't allow to push files from another referer than the one that's calling the API. So, long story short:
First you need to download the file to your server, then upload it to gDrive from your server.
Read here more: https://developers.google.com/drive/examples/php#saving_files
Or here: https://developers.google.com/drive/manage-uploads