Pagination for file listing using drive api in php - pagination

I am trying code for the pagination for listing files from drive API in PHP but I don't know how to use next page token.
Please suggest me about that.

Related

Upload file from google drive to my web app when user selects file from google drive picker

I am new to meteorJs framework. I have a use case like when an user clicks on a button google drive picker has to open after google authentication and when user select any file from the google drive that file should get uploaded to my collection(or if I get the readable stream can I upload the stream to my s3 bucket and can I view that file in front end ?).
How do I achieve this process in meteorJs ?
Can any one please explain, It will be very help full.
This is not a Meteor based question . But generally you would achieve this as you would using vanilla javascript . You could set this up in Meteor in a Template.onRendered callback or Tracker.autorun ,or anywhere convenient for you.
NB: Make sure your function doesn't execute before the Template is created .
I assume you know how to get blob/data from google driver api in your desired format.
Then you could check out these
https://github.com/vsivsi/meteor-file-collection
https://github.com/veliovgroup/Meteor-Files
https://www.mongodb.com/docs/drivers/node/current/fundamentals/gridfs/
Let me know if I helped .

SVG image Download URL Link is not working in FFImageLoading in Xamarin Forms [duplicate]

What I want to do is to create a direct link URL to a mp3 file which is located on my Google Drive and use it on Audio object of HTML5, but I get 403 error.
I know that when one tries to create a link of a file located on Google Drive, it creates not a direct URL to the file but a URL for viewing the file through a viewer such as
https://drive.google.com/file/d/<file ID>/view?usp=sharing
I googled to find it is possible to rewrite it into a direct link URL like this:
https://drive.google.com/uc?id=<file ID>
I set this URL in the src property of my audio element. However, when I try play() method, the following error is thrown:
GET https://drive.google.com/uc?id=<file ID> 403
myProject.html:1 Uncaught (in promise) DOMException: Failed to load because no supported source was found.
So I tried to access to the URL https://drive.google.com/uc?id=<file ID> from my browser.
Then, I got this:
403. That’s an error.
We're sorry, but you do not have access to this page. That’s all we know.
I tried many times so it is not likely that I'm mis-pasting the <file ID>.
What should I do to create a valid direct link URL of the file?
I would appreciate for any information.
Progress
I got what was wrong.
The problem was that a file on Google Drive can be accessed only from the user who is authorized, which means only the owner of the Google account can access the file URL.
I tried to access it from Chrome Browser which is associated with the Google account, then, the error didn't occur.
However, I want to serve this file to all the people.
What should I do to give permission for access to other people?
You understand that Google drive is not a file hosting service right? This solution is not going to be very stable even if you do get it to work.
For it to work your going to need to set the file public so that everyone can access it. Then i would be willing to bet you will need an API key to do this in the long run.
Also remember that file id is not stable it can change in the future if for example you upload the file.
I solved this on my own. I right clicked the file, clicked Get link, and changed the authorization selection from Restricted into Anyone with the link. Then, the 403 error vanished for the access from anyone.

Fetch excel files from FTP server and save in Google Drive

The requirement is to upload an excel file to Google Drive which file is initially being stored on an FTP server.
I would like to know if it is Possible achieving this through Google App Script. If not App script, is there any way in which we can fetch files from the FTP server and then upload it to Google Drive.
I found out about the Class UrlFetchApp.
var response = UrlFetchApp.fetch("http://www.google.com/");
makes request to fetch url.
UrlFetchApp.fetch("http://example.com/upload_form.cgi", parameters);
Makes a request to fetch a URL using optional advanced parameters.
I don't know if the above 2 methods would be of any use.
Well, I found on this thread that FTP access is currently unavailable for Google Drive.
But I found a tutorial here that can connect or integrate Google Drive to FTP. This tutorial use a multiple cloud storage manager that easily combine the two services together.
So if you are interested with it, just read the tutorial link to know more about MultCloud.

JavaScript REST-API file upload security/ACL

I have a HTML5 static site and use Parse as the back end through REST API.
So my application id and REST API key are completely open to the public.
My classes have ACL so it should be relatively OK. But I also upload files to https://api.parse.com/1/files/ using JavaScript through REST-API .
How can I allow that only logged in users can upload files? Unlike normal classes on which I can set class wide ACL, anyone can upload files to my parsing application.
First off I would ask why you are using the REST API instead of the native JavaScript API... the JavaScript API uses the REST API under the covers, it just adds a nicer layer of interaction to work with.
Anyway, that aside you can't stop people from uploading files unfortunately. You can stop them from assigning those files to records via ACLs though, and you can do a cleanup on files that are not linked to objects.

How to get a published video URL

I'm trying to build my app based on Windows Media Services REST API (i'm not using any SDK, just plain rest api requests).
My steps are more or less like:
Create Asset
Assign write Access Policy
Assign upload locator
Upload a file to URL specified by upload locator path
Assign download Access Policy
Assign download locator
All those steps seems to work great but - how can i actually get the video streaming URL? I can't see anything, which looks like such url (as far as i know, it should look similar to upload URL from upload locator). Should i "fold" it by myself using some segments from various parts of api ?
Based on this article, i should append the path parameter with name parameter and /manifest (so it should looke like that: <path_param>/<name_param>.ism/manifest) but it gives me ResourceNotFound error. Anyway, i've seen that other people (like SHIBSANKAR) have found some way to obtain all asset urls so i think there is some way to do it but they have not descrbed how they've done it.
After reading all the docs and talking with microsoft support, i have figured it out. All the URL parts are returned by download locator and the formula looks like that:
#{BaseUri}/video.mp4#{ContentAccessComponent}
I hope someone will find that usefull someday.

Resources