Download older version of a file from SharePoint Document Library using CSOM and 404 error

Hi,
I am trying to download previous versions including Major and Minor versions of documents from SharePoint Online using CSOM. I get 404 error when I try to download the file. I found several posts on various discussion forums where people are getting same
error but none of those have any solution/answer. Below is one of the threads and sample code I have tried that results in 404 error. If I use the link in browser directly, I am able to download the file. Also I am able to download the current version of file
using CSOM without any problem, it is only the older versions that give me 404 in CSOM.
http://qandasys.info/how-to-download-the-historical-file-version-content-using-csom/
public int GetStreamFromFile(string docid, string lib, string fileurl, ClientContext clientContext, int iuserid, string Version, bool isCurrrent)
if(!isCurrent)
List LibraryName = clientContext.Web.Lists.GetByTitle(lib);
clientContext.Load(LibraryName);
clientContext.ExecuteQuery();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "" + fileurl +
Microsoft.SharePoint.Client.ListItemCollection collListItem = LibraryName.GetItems(camlQuery);
clientContext.Load(collListItem, items => items.Include(item => item.Id, item => item["FileLeafRef"], item => item["LinkFilename"],
item => item["FileRef"], item => item["File_x0020_Size"], item => item["DocIcon"], item => item.File.Versions));
//clientContext.Load(collListItem);
clientContext.ExecuteQuery();
foreach (Microsoft.SharePoint.Client.ListItem oListItem in collListItem)
//string fileurl1 = (string)oListItem["FileRef"];
//string filename = (string)oListItem["LinkFilename"];
foreach (FileVersion version in oListItem.File.Versions)
if (Version == version.VersionLabel)
//Added excutequery to get object one more time as per blog
//http://social.technet.microsoft.com/Forums/de-DE/sharepointdevelopmentprevious/thread/88a05256-8694-4e40-863d-6c77512e079b
clientContext.ExecuteQuery();
FileInformation fileInformation = ClientOM.File.OpenBinaryDirect(clientContext,version.Url);
bytesarr = ReadFully(fileInformation.Stream);
Darwaish

Hi,
According to your description,
I know you want to get older version of a file from SharePoint Document Library using Client Object Model.
The following code snippet for your reference:
public void GetVersions()
ClientContext clientContext = new ClientContext(“http://SPSite”);
Web site = clientContext.Web;
clientContext.Load(site);
clientContext.ExecuteQuery();
File file = site.GetFileByServerRelativeUrl(“/Shared Documents/mydocument.doc”);
clientContext.Load(file);
clientContext.ExecuteQuery();
ListItem currentItem = file.ListItemAllFields;
clientContext.Load(currentItem);
clientContext.ExecuteQuery();
FileVersionCollection versions = file.Versions;
clientContext.Load(versions);
clientContext.ExecuteQuery();
if (versions != null)
foreach(FileVersion _version in versions)
Console.WriteLine(“Version : {0}”,_version.VersionLabel);
More information:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.file.versions.aspx
Best Regards,
Dennis Guo

Similar Messages

  • Is it possible to get Exchange emails downloaded to SharePoint document library using Powershell and or Custom Workflow?

    I have been asked to see if it would be possible to get  exchange emails downloaded and or sent to a document library .
    I know of the sitemail box app. but we are not running Exchange 2013.
    and setting up the lists and or document library to receive emails using the built in doesn't seem to be working...( maybe not configured correctly, i would need to see what the prior admin/developer did)
    But is there a way to get the emails downloaded to a document library using a workflow and or a powershell script that is triggered via  workflow?

    Hi,
    Since workflow can only work on items in SharePoint sites, they cannot get Exchange emails, let alone download emails to SharePoint library. However, you could manually save email to local and upload it to SharePoint list/library.
    I'd suggest you toubleshooting the incoming email settings in SharePoint. Please refer to the article below and check your configuration:
    https://technet.microsoft.com/en-us/library/cc262947.aspx
    http://blogs.technet.com/b/harmeetw/archive/2012/12/29/sharepoint-2013-configure-incoming-emails-with-exchange-server-2013.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to filter the Files from SharePoint Document Library based upon cloumn value

    Hi
    I should filter the files from document library. I have column called "Print Status" for the document library the value would be either "Yes" or "No".
    Now i should filter out the files which has "Print Status" as a "Yes".
    I am using SPFolder and SPFile from SharePoint Object Model to traverse the file in doc library.
    How could i do it?
    My Sample code:
    foreach (SPFolder childFolder in folder.SubFolders)
      if (childFolder.Name != "Forms")
        AspControls.TreeNode trn = new System.Web.UI.WebControls.TreeNode(childFolder.Name, "", "~/_layouts/images/itdl.gif", childFolder.ServerRelativeUrl.ToString(), "");
        newNode = TraverseFiles(childFolder, trn);
                                // add the new node to the tree
                                rootNode.ChildNodes.Add(newNode);
                        // loop through the files
                        foreach (SPFile childFile in folder.Files)
                            // create a new node and add to the tree
                            AspControls.TreeNode childNode = new System.Web.UI.WebControls.TreeNode(childFile.Name + " (" + childFile.TimeLastModified.ToShortDateString()
    + ")", Convert.ToString(childFile.Item["ID"]), "~/_layouts/images/" + childFile.IconUrl, childFile.ServerRelativeUrl.ToString(), "");
                            rootNode.ChildNodes.Add(childNode);
    Thanks
    Poomani Sankaran.

    Why do you transvers the file an not use a camp query? In a CAML query you can filter the print status and are able to get all files and folder objects at once.
    Check out the following post: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8c45b5e2-1fb8-435c-a97d-1d8c6d288d4c/caml-query-to-query-all-the-files-and-folders-in-document-library?forum=sharepointdevelopmentprevious
    Kind regards
    Stefan
    http://www.n8d.at/blog
    Follow me on Twitter: StFBauer |
    n8design
    Microsoft Community Contributor 2011 / 2012
    MCTS - SharePoint / WSS Configuration and Development

  • Adding file in SharePoint document Library using sandbox solution

     Why I am Missing Uploaded File name In Post back & am unable to add debugger give me solution thanks in advance
    Below is my sample code
    protected void btnsubmit_Click1(object sender, EventArgs e)
                try
                            //upload Image
                            web.AllowUnsafeUpdates = true;
                            Boolean replaceexistingfile = true;
                            if (Filephoto.HasFile)
                                Stream fStream = Filephoto.PostedFile.InputStream;
                                byte[] contents = new byte[fStream.Length];
                                fStream.Read(contents, 0, (int)fStream.Length);
                                fStream.Close();
                                string FileName = Filephoto.FileName;
                                string destUrl = SPContext.Current.Web.Url + DocumentLibName + FileName;
                                 web.Files.Add(destUrl, contents, replaceexistingfile);
                                SPFile file = web.Lists[DocumentLibName].RootFolder.Files.Add(FileName, contents, replaceexistingfile);
                                lblliteral.Text = file.ToString();
                                SPFieldLookupValue value = new SPFieldLookupValue(listitem.ID, listitem["EmployeeCode"].ToString());
                                file.Item["EmployeeCode"] = value.ToString();
                                file.Item.Update();
                            else
                                //throw new FileNotFoundException("File Not Found");
                                string FileName = "nofile";
                                lblliteral.Text = FileName + "filepload" + FilePassport.FileName + " : " + FilePan.FileName;
                            web.AllowUnsafeUpdates = false;
                catch (Exception ex)
                  //  Page.Response.Write(ex.Message);
                    string FileName = ex.Message;
                    lblliteral.Text = FileName;
                                                            

    Hi,
    We can put into the Session, the code snippet for your reference:
    //If first time page is submitted and we have file in FileUpload control but not in session
    // Store the values to SEssion Object
    if (Session["FileUpload1"] == null && FileUpload1.HasFile)
    Session["FileUpload1"] = FileUpload1;
    Label1.Text = FileUpload1.FileName;
    // Next time submit and Session has values but FileUpload is Blank
    // Return the values from session to FileUpload
    else if (Session["FileUpload1"] != null && (! FileUpload1.HasFile))
    FileUpload1 = (FileUpload) Session["FileUpload1"];
    Label1.Text = FileUpload1.FileName;
    // Now there could be another sictution when Session has File but user want to change the file
    // In this case we have to change the file in session object
    else if (FileUpload1.HasFile)
    Session["FileUpload1"] = FileUpload1;
    Label1.Text = FileUpload1.FileName;
    More information about the similar issue:
    http://www.codeproject.com/Tips/101834/How-to-Maintain-FileUpload-Control-s-State-after-P
    If you want to upload file into document library, here is another option for your reference:
    http://purtuga.github.io/SPWidgets/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Issues opening PDF files from SharePoint document library reader/pro 11.0.5

    Hello,
    We have a sharepoint 2010 enviroment and recently upgraded our Acrobat X11 installs ( both reader/std/pro) to version 11.0.5.
    We have a mixture of WIndows 7 32/64Bit IE 8 and IE 9 machines
    After upgrading to 11.0.5 when users click a pdf file in a SP document libary one of two things happens depending if they have the
    Adobe Reader Plugin Enabled or not
    If the Adobe Reader Plugin is enabled, they will not get prompted to run/save the pdf file and it will not open in a new tab in the browser
    If the Adobe Reader Plugin is disabled, they will get a popup window that has the correct URL to the PDF in the address bar but they will not be prompted to save or run the file.
    If they click in the addrss bar and press enter the pdf will then load in the external reader/acrobat application.
    This issue started with 11.0.5 updates, rolling people back to 11.0.4 fixes the issue.
    I have attempted everything I can think of including rebuilding new machines with our image.
    Has anyone see issues like this with the 11.0.5 update?

    If a bug is confirmed, a fix may be delivered in the next release (can't promise). For a similar issue caused by a Microsoft bug, see http://forums.adobe.com/message/6106294#6106294.
    Ben

  • Having trouble opening Crystal Report files from a document library

    I am trying to open Crystal Report .rpt files from a document library in either the native, client Crystal Reports software or in Crystal Reports Viewer. When I add the Crystal Report files to a document library and attempt to open them SharePoint displays
    a prompt asking me to save the file locally instead of opening the file. I have done a lot of research online and found several sites discussing similar scenarios, however, I have not been able to get these solutions to work. Here is a short list of sites
    I have referenced for possible solutions:
    http://naadydev.blogspot.com/2013/03/crystal-report-viewer-sharepoint-2010.html?showComment=1383339860122
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/52aabf2d-10dc-424c-bd50-124fc972a9b9/crystal-report-viewer-integration-with-sharepoint-2010?forum=sharepointgeneralprevious
    http://www.codeproject.com/Articles/42731/Crystal-Reports-WebPart-for-SharePoint
    Here are the steps I have done to try to get the .rpt files to open:
    Added the Crystal Report extension .rpt as a MIME type
    Installed the Visual Studio 2012 Crystal Reports Viewer toolbar
    Installed the 64-bit Crystal Reports runtime
    I have also created a solution file based off the Code Project site which partially works, but not quite right. In this project I have created a document library called "Crystal Reports rpt Files" and deployed the solution file to a site. When
    I open the Web Part Maintenance Toolbar I can see the selected .rpt file in the drop-down, but no Crystal Report file is displayed on the page itself.
    I am not sure what I am doing wrong. Does anyone have experience working with Crystal Reports and SharePoint 2013 (or earlier versions) that could lend some advice?
    Thank you,
    Alex

    We are having the exact same issue, has anyone resolved this yet?

  • Download older Version of Mountain Lion from App Store

    Hi,
    Since i have lot's of problems with 10.8.5 i wanted to know if there is a way to download an older Version of Mountain Lion from the App Store?
    I tried yesterday but it auto downloaded version 10.8.5. I tried to backup from time machine but this screwed up things completely...

    ...is a way to download an older Version of Mountain Lion from the App Store?
    Nope, your stuck with it breaking things or being buggy, no way to revert to a earlier verison.
    If you made a bootable clone you could, simply hold the option key and boot off the clone and reverse clone 10.8.4 back on.
    Most commonly used backup methods
    So since you can't go back, you can attempt to fix in place, provided it's not a OS X bug that has to be fixed.
    ..Step by Step to fix your Mac
    Your likely going to need to do #8 and restore OS X over itself, any third party software that doesn't work, check for a update or problems on the developers forums BEFORE reinstalling it or your problems will most likely return.

  • Sharepoint 2010 - Archiving the files from one document library to another document library in sharepoint site

    I have a requirement to move the documents from one document library to another document library.
    Source Library - DocumentLib
    Destination Library - Archive
    Archive document library will have folders by fiscal year.
    Source documentlibrary has files from year 2012 till date.
    Archive folder will have folders by fiscal year -(fiscal year starts from July1st -June 30th )
    If the document is created date  between 1st  July 2012 -June 2013 then move the document to Archive document library and in  folder Fiscal Year 2013.
    If the document is created date  between 1st  July 2013 -June 2014 then move the document to Archive document library and in  folder Fiscal Year 2014.
    The structure of destination document library folder should be same as source document library.
    Please find attached the screenshot of the requirement.
    Files Type - Excel,pdf,microsoft outlook item
    Could we use Sharepoint designer workflow to achive this task?
    Any help on this will be appreaciated.

    Hi Asritha,
    According to your description, you want to create a workflow to meet the need.
    Per my knowledge, there is no built-in action which can move the documents from the current library to a folder in another library.
    I recommend to use the custom activity 'Copy List Item Extended' which need to be downloaded from
    http://spdactivities.codeplex.com/.
    Please per the steps below to deploy the custom activity to SharePoint:
    Download the activity form http://spdactivities.codeplex.com/
    Open Dos command prompt.
    Browse to the directory that you can access stsadm.exe. The default location in version 3.0 is C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\bin
    Type the stsadm commands: stsadm -o addsolution -filename C:\UsefulSPDWorkflowActivities_0.5.0\DP.Sharepoint.Workflow.wsp (“C:\UsefulSPDWorkflowActivities_0.5.0\” is the file path)
    Type the stsadm commands: stsadm -o deploysolution -name DP.Sharepoint.Workflow.wsp -allowgacdeployment -force -immediate 
    Open the Center Administration, Click System Setting->Manage Farm Solution-> dp.sharepoint.workflow.wsp->Deploy to the Web Application.
    After that, we can create a workflow to meet the need.
    Here is the detailed steps to create the workflow:
    Create a workflow associated with the Source Library DocumentLib and set the workflow to start when an item is created.
    Select If current item field equals value, change the settings to be If Current Item: Created is greater than 7/1/2012.
    Select If current item field equals value, change the settings to be If Current Item: Created is less than 6/30/2013.
    Select Copy List Item Extended, change the settings to be Copy item in Current Item to list at Fiscal Year 2013 folder url.
    Select Delete Item, change the settings to be Delete Item in Current Item.
    Select If current item field equals value, change the settings to be If Current Item: Created is greater than 7/1/2013.
    Select If current item field equals value, change the settings to be If Current Item: Created is less than 6/30/2014.
    Select Copy List Item Extended, change the settings to be Copy item in Current Item to list at Fiscal Year 2014 folder url.
    Select Delete Item, change the settings to be Delete Item in Current Item.
    Publish the workflow.
    Best regards.
    Thanks

  • Schedule the Publishing date of a file in Document Library using CSOM

    I am having a hard time to schedule the publishing date of a document uploaded to a sharepoint document library. Basicaly, what I want is to upload a file to a document library and to schedule it´s publishing for a future date, using CSOM. Then someone should
    approve this (file content and scheduled date and time for publishing).
    I am able to upload the document to the document library and to start the approval workflow automatically (when the document is uploaded), but I don´t know how to set the publishing date using client side object model.
    Apparently all I need to do is to set up the properties ScheduledItem.StartDate and ScheduledItem.EndDate, but I just can´t manage to do it. Any help will be very much appreciated.

    I am having a hard time to schedule the publishing date of a document uploaded to a sharepoint document library. Basicaly, what I want is to upload a file to a document library and to schedule it´s publishing for a future date, using CSOM. Then someone should
    approve this (file content and scheduled date and time for publishing).
    Scheduling is enable and the coluns StartDate and EndDate are already added to the document library. I am able to upload the document to the document library and to start the approval workflow automatically (when the document is uploaded), but I don´t know
    how to set the publishing date using client side object model.
    Apparently all I need to do is to set up the properties ScheduledItem.StartDate and ScheduledItem.EndDate, but I just can´t manage to do it. Any help will be very much appreciated.

  • C#/REST Getting files in a document library using Internal Name

    Hi Folks,
    I need to get a list of files in a SP2010 and SP2013 document library using the REST API - this is occurring inside a timer service application so am using C#.  As a constraint I need to use the internal names for the document libraries - primarily
    because users tend to change the display name and this is an automated service.
    When I make a call to _api/web/GetFolderByServerRealitveUrl('/Shared Documents')/Files  I get a bunch of XML but how do I get just a list of filename+ext.   I am using Xdocument (LINQ to XML). I need to retrieve the name property in the
    contents sub element for all files returned.
    Second question, how to I change this to use the internal name '/Document' instead of '/Shared Document', so that it copes with users changing the display name of document libraries.
    Regards
    Andy

    Hi Andy,
    1.For your issue, you can refer to the code as below:
    using System.Xml;
    namespace REST_XML_LIST_GET
    class Program
    static XmlNamespaceManager xmlnspm = new XmlNamespaceManager(new NameTable());
    static Uri sharepointUrl = new Uri("Site URL/");
    static void Main(string[] args)
    xmlnspm.AddNamespace("atom", "http://www.w3.org/2005/Atom");
    xmlnspm.AddNamespace("d", "http://schemas.microsoft.com/ado/2007/08/dataservices");
    xmlnspm.AddNamespace("m", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
    NetworkCredential cred = new System.Net.NetworkCredential("username", password", "domain");
    HttpWebRequest listRequest = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + "_api/Web/lists/getByTitle('List Name')/items");
    listRequest.Method = "GET";
    listRequest.Accept = "application/atom+xml";
    listRequest.ContentType = "application/atom+xml;type=entry";
    listRequest.Credentials = cred;
    HttpWebResponse listResponse = (HttpWebResponse)listRequest.GetResponse();
    StreamReader listReader = new StreamReader(listResponse.GetResponseStream());
    var listXml = new XmlDocument();
    listXml.LoadXml(listReader.ReadToEnd());
    //Method 1 Seperate node list
    var titleList = listXml.SelectNodes("//atom:entry/atom:content/m:properties/d:Title", xmlnspm);
    var idList = listXml.SelectNodes("//atom:entry/atom:content/m:properties/d:ID", xmlnspm);
    int i = 0;
    foreach (XmlNode title in titleList)
    Console.WriteLine(title.InnerXml+" "+idList[i++].InnerXml);
    //Method 2 single node list
    var prop = listXml.SelectNodes("//atom:entry/atom:content/m:properties", xmlnspm);
    foreach (XmlNode ndlist in prop)
    Console.WriteLine(ndlist.SelectSingleNode("d:Title", xmlnspm).InnerXml + " " + ndlist.SelectSingleNode("d:ID", xmlnspm).InnerXml);
    Console.ReadLine();
    2. For a workaround, you can get the display name based on the internal name and use the display name in the Rest API.
    Reference:
    http://www.c-sharpcorner.com/UploadFile/Roji.Joy/working-with-sharepoint-2013-rest-api-in-a-C-Sharp-managed-code/
    https://dlr2008.wordpress.com/2013/11/14/sharepoint-2013-rest-api-the-c-connection-part-4-document-libraries-folders-and-files/
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Eric Tao
    TechNet Community Support

  • How to know whether file is modified or metadata from SharePoint Document Library version history

    I have uploaded a document in document library. I am writing code to retrieve the items from the library only if document is modified, not the metadata.
    So if for an item only metadata is modified then it should not come, if document is modified then it should come. I tried from version history but it doesnt work. Any idea?
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

    Each file has an associated SPListItem which contains the metadata. See if the SPFile.TimeLastModified reflects the file and not the metadata.
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.timelastmodified.aspx
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Download RSS feed as xml file from Sharepoint Online using PowerShell

    Hello
    Our company sharepoint (Office 365) contains also several RSS feeds.
    How it is possible to download xml file out of this feed (website) using PowerShell?
    I can authenticate with sharepoint using CSOM but do not what to do next.
    As service user is not administrator I cannot use "SPOService".
    This script works OK for standard website, but not for Sharepoint.
    $doc = New-Object System.Xml.XmlDocument
    $doc.Load("http://www.{CompanySite}.com/feed/")
    $doc.save("C:\temp\feed.xml")
    I am getting this error when using for company Sharepoint:
    "The remote server returned an error: (403) Forbidden."
    Thanks for your time considering this question.
    Jozin

    Hi Scott,
    thanks for advice.
    Combination of WebClient and Sharepoint Credentials is working OK:
    $client = New-Object System.Net.WebClient 
    $client.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User, $SecurePassword)
    $client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f")
    $client.DownloadFile($SiteURL, $file)

  • Unable to add aspx file to document library using REST and JSOM in SharePoint Hosted App

    Hi,
    I am unable to add an aspx file to document library.  I was actually trying to create a WIKI page and upload to Pages library but that wasn't working so I tried simple document library.  It keeps failing with Access Denied error.  I have checked
    the blocked types and aspx is not included.  I can upload it directly from the browser so that shouldn't be the case.  I have read that it can be achieved with CSOM but I need this to work with a SharePoint Hosted App.  Here is my JSOM:
    factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
        context.set_webRequestExecutorFactory(factory);
        appContextSite = new SP.AppContextSite(context, hostweburl);
        oWeb = appContextSite.get_web();
        oList = oWeb.get_lists().getByTitle('Documents');
        fileCreateInfo = new SP.FileCreationInformation();
        fileCreateInfo.set_url("mywiki.aspx");
        fileCreateInfo.set_content(new SP.Base64EncodedByteArray());
        fileContent = "<%@ Page Inherits=\"Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c\" %> <%@ Reference VirtualPath=\"~TemplatePageUrl\"
    %> <%@ Reference VirtualPath=\"~masterurl/custom.master\" %>";
        for (var i = 0; i < fileContent.length; i++) {
            fileCreateInfo.get_content().append(fileContent.charCodeAt(i));
        newFile = oList.get_rootFolder().get_files().add(fileCreateInfo);
        context.load(newFile);
        context.executeQueryAsync(function () {
            alert('yo');
        }, function (sender, args) {
            alert(args.get_message() + '\n' + args.get_stackTrace());
    If I change the file extension to "txt", it works.  Same with REST implementation, it works with "txt" but fails with "aspx".  Maybe what I am trying to do will not work using JSOM or REST.  Any suggestions?  Your
    help is always appreciated.
    Regards,
    kashif

    Your code works fine in both my on-premises and SharePoint Online. I have given the app full control, so I suspect this is a permissions issue. I would check your permissions on your appmanifest. Must be something to do with publishing permissions. Try
    giving full control and work the permissions down.
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Moving files from one document library to another

    I want to move all files which are 30 days old, from one library to another.
    What is the best way to do this?
    Shall I create a workflow for this or a timer job? I am not sure if we can do this using workflow because I think it works on events and here I need a process that will work continuously (for e.g. every hour or every day etc) and check for files which are
    30 days older, and move to different document library (this target library will be in another site collection).
    What do you say?

    There are 2-approach I would recommend here,
    Either Create SharePoint Timer Job OR Create Windows Service which runs every day and will check the document library for any documents satisfy the 30 days old criteria.
    Personally I will always go for Windows service. Reasons are easy to build/install/less downtime and if you use framework like Topshelf then easy to debug. Also it allows you to have configuration for your SharePoint Site/Document library. Libraries like
    Serilog allows you to have better structured logs created for your service easily. Multiple instances of the same service running on the same server.
    There are few links I want to share with you for kind of similar discussion happened earlier,
    http://sharepoint.stackexchange.com/questions/96089/when-should-we-use-sharepoint-timer-job-and-when-windows-task-scheduler
    https://social.msdn.microsoft.com/forums/sharepoint/en-US/abd71245-8f64-40ba-8861-a852893cd8d5/timer-job-vs-custom-windows-service
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/c87abaec-7cf2-4697-bf2d-31d235541598/sharepoint-timer-job-vs-windows-schedule-to-consume-web-service?forum=sharepointadminprevious
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this
    will help others who are looking for solutions to the same or similar problem.

  • Edit CSV files present in document library using Microsoft Excel

    Hi all
    I have a document library with CSV files uploaded. I have used the below mapping in DOCICON.xml present in \14\TEMPLATE\XML folder.
    <Mapping Key="csv" Value="csv16.gif" EditText="Microsoft Excel" OpenControl="SharePoint.OpenDocuments"/>
    And I modified mime type with "application/vnd.ms-excel" for csv in IIS7. Now, when i click on the file  popup is getting displayed with 2 Radio Buttons.
    1) Read Only
    2)Edit
    When i select "Read Only", the file is opening in Microsoft Excel in readonly mode But when i select "Edit", the file is opening in Note pad and its editable.
    Now, My requirement is to edit the csv file in Microsoft Excel not in NotPad.
    Can Any one help me to acheive this!! Thanks in advance.

    Try below:
    http://nickgrattan.wordpress.com/2011/01/05/sharepoint-opening-csv-files-with-microsoft-excel/
    Run the “Internet Information Services (IIS) Manager” application from the Start/Administrative tools menu.
    Select the server in the left-hand pane.
    Select “MIME Types” in the list of options in the middle pane.
    Then locate the .CSV entry (it should already exist) and change the MIME type to: application/vnd.ms-excel, and click
    OK.

Maybe you are looking for

  • Change a date to a workday in CATS worklist

    Hi Experts, I have a request to change a date in the CATS worklist from holiday to a workday. I have no idea about CATS. Would you please give me an idea how a date is defaulted as a holiday in CATS (and the work hrs is distributes as 0 hrs). Is ther

  • When using numericupdown to expand/collapse treeView nodes. Why the collapse part is not working ?

    I have a treeView in my form1 designer. The treeView variable name is: treeViewMS1 When i'm running my program the treeView is automatic expanded to level 1: Now if i click on the numericUpDown and change the value to 2 then: So the expanded part is

  • Add CCS - R/3 objects in tx CRMD_EMAIL

    Hi All, I need to use CCS or R/3 objects in my letters made on tx CRMD_EMAIL in CRM 5.0. But I only know how to use CRM objects using scenarios in this tx. What I need to know is if there is any way to bring CCS or R/3 object fields to use in CRMD_EM

  • Slow logout on remote connection.

    If I use CDE, I login and out fast. If I use JDS, I login and out takes forever. Is JDS so much more resource intensive?

  • Older Software Compatibility with Yosemite

    Will I have any problems working with older apps in Yosemite (i.e. VueScan, Quicken 2007, Microsoft Office 2008)? Is there a listing anywhere on this site or at Apple for compatibility issues?