Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Sharepoint 2010 External list

Sharepoint 2010 External list

Scheduled Pinned Locked Moved SharePoint
sharepointtutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gautam
    wrote on last edited by
    #1

    How to add Attachment link to External list

    D 1 Reply Last reply
    0
    • G Gautam

      How to add Attachment link to External list

      D Offline
      D Offline
      DigiOz Multimedia
      wrote on last edited by
      #2

      Do you mean attachments (aka attach files to an external sharepoint site)? If so here is a code that should do the trick for you:

                  try
                  {
                      WebClient loClient = new WebClient();
                      loClient.Credentials = new NetworkCredential(Utility.GetConfigKey("SharePoint ACCOUNT"), Utility.GetConfigKey("SP Account Password"), "Domain Name");
                      byte\[\] myDataBuffer = loClient.DownloadData(new Uri(Utility.GetConfigKey("SharePoint URL") + lsFileName));
      
                      // Clear all content output from the buffer stream
                      Response.Clear();
                      // Add a HTTP header to the output stream that specifies the default filename
                      // for the browser's download dialog
                      Response.AddHeader("Content-Disposition", "attachment; filename=" + lsFileName);
                      // Add a HTTP header to the output stream that contains the 
                      // content length(File Size). This lets the browser know how much data is being transfered
                      Response.AddHeader("Content-Length", myDataBuffer.Length.ToString());
                      // Set the HTTP MIME type of the output stream
                      Response.ContentType = "application/octet-stream";
                      // Write the data out to the client.
                      Response.BinaryWrite(myDataBuffer);
                  }
                  catch
                  {
                      lblFormError.Text = "Unable to add document to sharepoint list location";
                  }
      

      Pete Soheil DigiOz Multimedia http://www.digioz.com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups