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

  • Home
  • SEARCH
  • 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 4015052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:34:18+00:00 2026-05-20T09:34:18+00:00

I am trying to download the file from the document using sharepoint webservices called

  • 0

I am trying to download the file from the document using sharepoint webservices called copy.asmx. its onlt 100 kb file size.

But its not downloading the file.

The web services iteself return empty stream (out byte[] Stream) in the web service response. is that any memory issue.

Also it returning like “download_document()out of memory”

Note: I am using the MFP printer to view this application.

  • 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-05-20T09:34:19+00:00Added an answer on May 20, 2026 at 9:34 am

    Please try below function. you need to pass FileURL(Full web url for document), Title(Pass name you want to give for downloaded file.)

    public string DownLoadfiletolocal(string FileURL, string Title)
    {
    
    //Copy.Copy is a webservice object that I consumed.
    
    Copy.Copy CopyObj = new Copy.Copy();
    CopyObj.Url = SiteURL + "/_vti_bin/copy.asmx"; // Dynamically passing SiteURL
    NetworkCredential nc2 = new NetworkCredential();
    nc2.Domain = string.Empty;
    nc2.UserName = _UserName;
    nc2.Password = _Password;
    
    
    string copySource = FileURL; //Pass full url for document.
    
    Copy.FieldInformation myFieldInfo = new Copy.FieldInformation();
    Copy.FieldInformation[] myFieldInfoArray = { myFieldInfo };
    byte[] myByteArray;
    
    // Call the web service
    uint myGetUint = CopyObj.GetItem(copySource, out myFieldInfoArray, out myByteArray);
    
    // Convert into Base64 String
    string base64String;
    base64String = Convert.ToBase64String(myByteArray, 0, myByteArray.Length);
    
    // Convert to binary array
    byte[] binaryData = Convert.FromBase64String(base64String);
    
    // Create a temporary file to write the text of the form to
    string tempFileName = Path.GetTempPath() + "\\" + Title;
    
    // Write the file to temp folder
    FileStream fs = new FileStream(tempFileName, FileMode.Create, FileAccess.ReadWrite);
    fs.Write(binaryData, 0, binaryData.Length);
    fs.Close();
    
    return tempFileName;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to download a file from a website using python and mechanize.
On Ubuntu, I am trying to download a file (from a script) using wget.
I am trying to implement an Asynchronous file download from a web server using
I'm trying out http requests to download a pdf file from google docs using
I am trying to download a file from dropbox using the RESTful API. When
I'm trying to download file with Python using IE: from win32com.client import DispatchWithEvents class
I'm trying to download content from a Google docs file using Javascript using the
i'm trying to download .zip file from bluehost server to my computer. Like this
I'm trying to download the XLS file from this page: http://www.nordpoolspot.com/Market-data1/Elspot/Area-Prices/ALL1/Hourly/ (click on Export
I'm trying to download an xml file to parse from a server, but the

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.