Information regarding the origin and location of the exception can be identified using the exception stack trace below. Please review the stack trace for more information about the error and where it originated in the code.Įxception Details: 32Exception: Access is deniedĪn unhandled exception was generated during the execution of the current web request. It gives following errorĭescription: An unhandled exception occurred during the execution of the current web request. It is working very fine in Local, but when I deploy it on Server it is giving error in Download part where we use “GoogleWebAuthorizationBroker.AuthorizeAsync” method to get Service credentials. I have written a code to Upload and Download files using from Google Drive. This way i can keep the data backed up and in sync. I have considered setting up a windows service to mirror my google drive account down to my PC and back up to Google Drive. String scopes = new string ) ĭriveDownload.Download(service, item, files from Google drive can be quite useful using media downloader makes it quite simple. It is best to request only what you need and not all of them These are the scopes of permissions you need. Throw new Exception("clientSecretJson file does not exist.") Throw new ArgumentNullException("clientSecretJson") If (string.IsNullOrEmpty(clientSecretJson)) Throw new ArgumentNullException("userName") Public static DriveService AuthenticateOauth(string clientSecretJson, string userName) / DriveService used to make requests against the Drive API / Identifying string for the user who is being authentcated. / Path to the client secret json file from Google Developers console. / This method requests Authentcation from a user using Oauth2. We also need a users permission to download the file once we have listed it. In order to access it you must be authenticated to that user. Install-Package 3 Authenticateįile list is private data which means it is owned by a user. The first thing we will need to do is import the Google Drive API v3 NuGet package
0 Comments
Leave a Reply. |