When I upload any file then it will automatically add in my google drive in google doc format account by php code.
What will be the steps by step process to do this
You need to insert the file, making sure you pass the convert=true parameter. Try out the PHP quickstart guide to get started.
Related
I am currently exploring Google Drive APIs and am able to upload an individual file using Postman successfully.
I tried to create/upload a folder using Google Drive API but failed. In fact, I don't see any specific API to deal with a folder. I was giving it a try with create files API.
Reference - https://developers.google.com/drive/api/v3/reference
Any help will be appreciated.
If you check the documentation for files.create you will notice at the top it states
Creates a file.
This is singular each request creates a single file. If you want to upload a directory you will need to first create the directory then upload each file one at a time.
You could try batching but I don't think you can batch the file upload itself you could probably batch the metadata creation performance#details
I am trying to see if I can update created and modified date of a mp4 file on Google drive.
This is not a question from a developer stand point but anything that can help me to get the job done would work. That said, if there is some way in Google Drive UI (Web App or smart phone app etc.) or using [Google's API harness][1]
to update the modified date of a file, I am ok with it. If your answer includes using API harness, please let me know where can I get the values for the API's parameters so I can run the API call from my login.
Just curious, if I somehow manage to update the modified time of the same file on my computer's hard drive, and then upload it (replace/revise an existing file on Google drive) would it read the meta-data from the file, or Google would use the time I uploaded the document as "modified date"?
Please note:
This is not specifically Google Drive API question, but if Google has an API test harness and I can put in some parameters there to update the file meta-data, I do not mind going to that route.
i want to download attachment from gmail and save it to local folder using google script. i did some research about this and i could't find any solution.
so far, i managed to save gmail's attachment to google drive only.
var attachmentBlob = attachment[0].copyBlob();
var file = DriveApp.createFile(attachmentBlob);
folder.addFile(file);
or, is it possible to create a google script to auto download file from google drive?
need some advice.
As #Sujay already mentioned you cannot download a file to a local folder using Google AppScript because GAS runs server-side.
You have already taken a good step with the code to save the attachment as a file to your Google drive.
To answer your sub-question 'is it possible to create a google script to auto download file from google drive?', you do not need a script to do that, that is what the Google Drive Desktop App (https://www.google.com.ng/drive/download/) does exactly.
It syncs all the files you add to your drive to your local-pc. You can also edit Google Drive preferences to sync select folders only, in your case that might be the drive folder referenced in your folder variable.
GAS runs on the server side, and only has access to Google's internal architecture. To save locally it'll need to create some kind of a blob and trigger a download within your browser. not sure if you can do that.
I have some particular files stored on my Google Drive with the extension of "bch". I need to be able to have a user click on this file in Google Drive and have it initiate the browser download prompt.
I was thinking that the way to do this would be to create a script that has the file information passed to it as a parameter and then execute the download request. I was hoping to define the file extension in the script so all files with this extension would be defaulted to run this script/app in Google Drive.
Has anyone done anything like this? If you could point me to some Google Apps Script examples I would greatly appreciate it. Thanks!
Is it possible to send data from the JavaScript to the Google Drive . I am trying to send my local storage datas to the google drive.
Kindly suggest me a solution for the same.
The Google Drive SDK documentation includes a complete JavaScript quickstart guide that shows how to upload a file to Drive from JavaScript:
https://developers.google.com/drive/quickstart
It should be pretty straightforward to edit the sample code to use local storage instead of the file uploaded from a form.