.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Document Library version restore not behaving as expected on the "Name" column (file name)

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :SharePoint

After a rollback to a previous version, the value of the column "Name" in a document library is not restored. All other columns are restored properly. It seems that the column "Name" (file name) is excluded from the process of versioning.

I didn't find information on this behaviour on the internet. Any suggestions ?


View Complete Post

More Related Resource Links

View previous version of a file in document library using Client Object Model




Using Server-side object model, it is pretty simple to get the previous file versions. Say I wanted to view a file in its initial version, all I’d need to do is :




When using Client object model, I couldn’t any analogous method/property which would let me fetch the previous version of file.

Can somebody point me to a sample or the property which would serve my purpose?

Restore a previous version of a document in a document library - error

  When I try to restore a previous version of a document in a document library, I get this error message:

"Updates are currently disallowed on GET requests. To allow updates on a GET, set the AllowUnsafeUpdates' property on SPWeb"

I am NOT running any custom code anywhere on my SharePoint site 

Recover last version of file properties in MOSS document library


After an overwrite to several hundred files we need a quick way to either restore the entire file to the previous version or ideal just the custom property fields.

I tried to find a way to script a query into the document library and collect the previous version custom data into an excel spreadsheet but could not find a solution.

I came across this post that indicated he was able to restore only the file properties but retained the current version (which was not his gold but would be mine).


He included a snippet of his code:

Would this work? is there a powershell equivalent?

Whats the easies way to make this code into a useful solution.


int versionCount = item.Versions.Count;
if (versionCount > 0)
// this only restores properties

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

File Attachments from info-path forms to Sharepoint document library


Hi Experts,

How to upload file attachements from info-path forms to Sharepoint document library?

I need to add attachement from local-PC/Any User to Sharepoint Document Library.


Any help please?? Appreciated




Creating a custom column with a link to document (other than the name field) in document library



I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!


Reg File Upload control to upload files from document library


In Field Upload control if we click browse button it allow us to search file in our hard disk but now as per my requirement as soon as user clicks ‘Browse’ button it should point to the document libraries and their files in site.Let me know how could i achieve this?

Thanks & Regards,


how to automatically save new file into document library with a unique name or ID?

I've created a form using MS Word Document (2007) and lock it (protect it) so that users will be able to fill in the required fields.
then i've created a Content Type and uploaded the MS word form to be used as a template.

Then I've created a document library and enabled the content type and associate the above form for the library, so that when users click on New button the form will open.

everythings goes fine till here.

The problem is when users clicks on New and save the file back to the library, It doesn't save it with a unique name, instead it is over writting the existing one.
in other words, if employee 1 fill up the form and save it and later on employee 2 accessed the library and fill up a new form, he will overwrite what employee 1 has already saved!!

Is there a way to give every new created file a unique name? maybe (username+time)??

Can't save SQL Server Management Studio sql file back into Sharepoint Document Library

I created an sql query file in SQL Server Management Studio and saved it onto my hard drive.  I then moved that file into a Sharepoint Document Library so others on my team could use that query.I opened the file from within sharepoint, it launched SSMS.I made a change to the file and pressed save.here is the error message that comes up."The operation could not be completed.  The process cannot access the file because it is being used by another process"Am I doing something wrong?

How can I display the notes for a file in a document library?

I have a document library with several office documents in it.  Currently, users select a document and the click the "Tags and Notes" button on the ribbon, then click the "Note Board" tab on the resulting pop-up in order to read or post notes.   What I have been asked for, is a connected web part that would display the notes associated with the currently selected document. The "Note Board" web part does not appear to accept connections.  Am I missing something?  Any ideas? TIA

Uploading a file to a document library produces access denied error, but only on first try.

Hi I have a task which uses a custom form which is part of a custom workflow.  The form incorporates an asp fileUpload control to allow a user to browse for a local file which they can then select and it will be upload a file to a folder in a document library.  The first time this action is performed the folder in the document library will not exist so the code creates a folder and then uploads the file to it. The problem I have is, the first time users try and upload a file the directory is created in the document library as expected, but then the user gets redirected to the standard SharePoint Access Denied page.  If the user goes back to the task list, then loads the task web page again, selects the same file and hits upload, then the file is uploaded fine. All subsequent file uploads work fine after that for all users. Users have Contribute permissions on the document library. The code to do the upload is as follows.  The task has a "CR Number" associated with it, which the directory in the doc library should be called.  It uploads the file to a stream.  Then gets the url of the web and works out the file url and uploads it.  The creation and checking of the folder in the doc library happens in the getDirUrl method. /// <summary> /// Processes an uploaded file. /// </summary> /// <param name="

Where is the document library setting "Unique file names"?

Live can be so simple if only… ;-).   When using DMS functionality unique file names must be possible. The name is an unimportant attribute when using Meta data. So why can I not choose somewhere in the document library settings something like:   ·         Generate unique filenames Or ·         Do not allow overwrite existing filenames   Maybe in the first service pack?   MS? Please, please, please  

Uploading doc file into SharePoint Document library Programatically.

Hi all, I want to upload the doc file into SharePoint document library using the FileUpload control. For that I am created a new document library in my SharePoint site. But I am not getting the path of Document library where I want to upload the file. Waiting for your valuable response. Regards,-Kaustubh

convert .eml file to .msg file in a document library

Hi All, My requirement is as follows. I have a document library to which users will upload .eml files.On the itemadded event of this doc lib, i'll have to convert the eml file to .msg file. Any help on ways to achieve this is appreciated.Hanif

Convert the .eml file to .msg file in a document library

Hi All, My requirement is as follows. I have a document library to which users will upload .eml files.On the itemadded event of this doc lib, i'll have to convert the eml file to .msg file. Any help on ways to achieve this is appreciated.Hanif

Tagging a file from a document library

Hi,   I'm using the following code to tag a file: SPServiceContext context = SPServiceContext.GetContext(site); SocialTagManager tagManager = new SocialTagManager(context); TaxonomySession taxSession = tagManager.TaxonomySession; TermStore termStore = taxSession.DefaultKeywordsTermStore; Term tag = null; string[] terms = subject.Split(new char[] { separadorAssunto }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < terms.Length; i++) { string termStr = terms[i].Trim(); TermCollection searchTerms = termStore.KeywordsTermSet.GetTerms(termStr, termStore.DefaultLanguage, true); if (searchTerms.Count == 0) { tag = termStore.KeywordsTermSet.CreateTerm(termStr, termStore.DefaultLanguage); } else { tag = searchTerms[0]; } tagManager.AddTag(new Uri(site.Url + fileUrl), tag); Unfortunately, this doesn't work... the file doesn't get tagged. What am I doing wrong?   Thank you!    

Windows 7, Office 2007, and WSS 3.0: Losing file path when saving to Document Library.

A client of ours recently purchased 5 desktops with Windows 7 and Office 2007.  They use Sharepoint to share all documents for their company. The computers that have Windows XP on them can browse the Sharepoint site, open documents (read only or edit), and chose to Save or Save As.  A new window pops open with their current file path of the Sharepoint Document Library so they can save the file in the same folder they opened it from.  I have tested this with Office 2003 and 2007 (Word and Excel) on XP and it always works. The 5 new desktops running Windows 7 cannot do this.  When a user opens a document by browsing to it from Internet Explorer and chooses to Save or Save As, they are kicked back to their last successful save point (usually My Documents or Desktop). The current work around is mapping a drive to the root Document Library directory and having them traverse through the folders to save it back in the original location. I've tried changing the Check Out save settings in Word 2007 and Excel 2007 to edit directly on the server, but I run into the same problem.  I've also made sure that IE sees the site as a Local Intranet site and Protected Mode is off. Any help would be appreciated.  Thanks in advance.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend