-1

I want to access my own google drive on web page but allow anyone to upload files and restrict download access or show only limited file to user for downloading.

Drive API assumes that I will access another users credentials. But what I want is opposite, anyone can view my files (restricted what to view) but is free to upload. I have google nearly 6+ hours and didn't found any solution

Any Help Appreciated Thanks

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • welcome to SO. You shouldn't ask 2 questions in 1. I've edited your question to be only about Google Drive, and you should post a new question about Dropbox. You should also make your title more specific. – pinoyyid Mar 01 '15 at 03:11

1 Answers1

0

You say "Drive API assumes that I will access another users credentials" but this isn't correct. Calls to Drive include an Access Token, and it is that which determines which Drive account the call will access. Drive makes no assumptions about how that Access Token was obtained or which account it refers to.

All of the examples show how an Access Token is obtained for an end user, since that is the more complex flow. Your requirement is very much simpler.

All you need to do is:-

  1. Obtain a refresh token (see How do I authorise an app (web or installed) without user intervention? (canonical ?))
  2. Store that refresh token in your PHP application. Make sure it's secure
  3. When you need to access your Drive account, use the refresh token to obtain an access token as described at https://developers.google.com/accounts/docs/OAuth2WebServer#refresh
Community
  • 1
  • 1
pinoyyid
  • 21,499
  • 14
  • 64
  • 115