Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8926017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:51:40+00:00 2026-06-15T07:51:40+00:00

I was just curious, is it possible to have direct network transfers in c#,

  • 0

I was just curious, is it possible to have direct network transfers in c#, without local caching.

e.g.
I have response stream which represents GoogleDrive file and request stream to upload file to another GoogleDrive account.

At that momment I can download file to local pc and next upload it to the google drive. But is it possible to upload it directly from one google drive to another or, at least, start uploading before full download will be completed.

Thank

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:51:42+00:00Added an answer on June 15, 2026 at 7:51 am

    Yes you can, with Google Drive api you download file into a stream and you keep it in memory so you can upload it to another google drive account after login.

    You get your token on first account and download a file keeping it in a stream.

    THen you authenticate on other google drive account and upload the file using the stream.

    PS: When you are inserting the file on the second drive account, instead of getting
    the byte[] array reading the file from disk you get the byte array from the stream you have in memory.

    File Download Example:

    public static System.IO.Stream DownloadFile(
          IAuthenticator authenticator, File file) {
        if (!String.IsNullOrEmpty(file.DownloadUrl)) {
          try {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
                new Uri(file.DownloadUrl));
            authenticator.ApplyAuthenticationToRequest(request);
            HttpWebResponse response = (HttpWebResponse) request.GetResponse();
            if (response.StatusCode == HttpStatusCode.OK) {
              return response.GetResponseStream();
            } else {
              Console.WriteLine(
                  "An error occurred: " + response.StatusDescription);
              return null;
            }
          } catch (Exception e) {
            Console.WriteLine("An error occurred: " + e.Message);
            return null;
          }
        } else {
          // The file doesn't have any content stored on Drive.
          return null;
        }
    

    File insert example:

    private static File insertFile(DriveService service, String title, String description, String parentId, String mimeType, String filename) {
        // File's metadata.
        File body = new File();
        body.Title = title;
        body.Description = description;
        body.MimeType = mimeType;
    
        // Set the parent folder.
        if (!String.IsNullOrEmpty(parentId)) {
          body.Parents = new List<ParentReference>()
              {new ParentReference() {Id = parentId}};
        }
    
        // File's content.
        byte[] byteArray = System.IO.File.ReadAllBytes(filename);
        MemoryStream stream = new MemoryStream(byteArray);
    
        try {
          FilesResource.InsertMediaUpload request = service.Files.Insert(body, stream, mimeType);
          request.Upload();
    
          File file = request.ResponseBody;
    
          // Uncomment the following line to print the File ID.
          // Console.WriteLine("File ID: " + file.Id);
    
          return file;
        } catch (Exception e) {
          Console.WriteLine("An error occurred: " + e.Message);
          return null;
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just curious to know if it is possible to have a pointer
I was just curious to know if it is possible to have a pointer
Just curious, is it possible to have Model Validation do the following: NewPassword can
Just curious if it is syntactically possible to do something like this: static (void)
Possible Duplicate: Why should I use templating system in PHP? I was just curious
Just curious what is the best practice for solving the following issue. I have
I am just curious if it possible to use const value as lock, for
I'm just curious why class/property attributes in VB.NET have a weird optional syntax such
I'm just curious as to if creating an object on the fly is possible
I'm just curious if you can bypass the login into a asp.net website, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.