.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

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

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :SharePoint
  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 

View Complete Post

More Related Resource Links

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


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 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?

Error adding a document library to a site



I am receiving the error "Cannot complete this action.  Please try again"  when trying to add a document library to one of the sites.  This is Sharepoint 2007 SP1.  I seem to be able to do it thru designer but not the web interface.

Does anyone know how to fix this?

HTTP 400 Bad Request Error when uploading to document library


I am running MOSS 3007 Standard on Windows 2003. When trying to upload files larger than about 29Mb, I am getting an HTTP 400 Bad request error. The error states "HTTP Error 400 - Request is badly formed." I am able to successfully upload a 28Mb file. Sharepoint is configured to accept files up to 75Mb.

I have done a fair amount of research on this, but none of the solutions seem to apply to our environment. The two most likely candidates do not apply, for example we are NOT running URLScan (there are a variety of solutions suggesting this could be an issue with uploads of 30Mb or more), and we are on 2003 with IIS6, so again the issue relating to 2008 and IIS7 do not apply.

The "Request is badly formed" part of the request is particularly confusing as most issues I have come across where this error is the symptom point to errors in custom code that is trying to talk to SharePoint. We have done none of our own custom coding and this error is occurring when attempting a simple upload to a document library.

Trying to drag and drop the file across when the document library is open in windows explorer also fails.

I did come across someone saying they had a similar problem which was caused by a damaged content database, however in this case, it is occuring regardless of which content database I use, so either they are all corrupt

"This document could not be checked out" error in IE with SP2010 doc library

We created a document library in Sharepoint 2010 and configured it to require checkout. Via Internet Explorer, users click on a document in the library and choose "Check Out and Edit". They get the error message "This document could not be checked out. You may not have permission to check out the document or it is already checked out or locked for editing by another user". We confirm that the document is not checked out to anyone else. The user is able to open the document Read Only from IE and then check it out in the application (for example, they can click the Check Out button in Word 2007 successfully), so the problem seems to be IE related. We have tried adding the Sharepoint site in the Trusted Sites and Local Intranet zones in IE, but it doesn't make a difference.Any suggestions?Thanks.

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="

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

Currency and number column error with office 2007 document formats in SharePoint 2010 library

Hi there,



The following error occurred within a SharePoint 2010 document library:

As I tried to test out the new SharePoint 2010 environment I changed the metadata from a few documents within a document library. I noticed that the data from the currency und number field was incorrect from a few documents. The numbers looked like that the decimal separator were ignored. For an example: 123.456,78 was saved as 12.345.678.

At first I thought it could be a language incompabilty but if that would be the case: Why would there be other documents which show the correct number?


I created another document library to recreate this error. And there I noticed the real reason: Every time I changed these fields from a document which was saved in the office 2007 format the error occurred. The metadata from the documents in the office 2003 format were correct.


Has anyone a similar problem or got an idea how to solve this problem?


System Specs:

Frontend: Windows Server 2008 SP2 ent

Error while downloading and uploading Documents from document library



We have a set of documents in a document library, which we are trying to download. if i click on the document and try to download, it takes a lot of time and then reports a error message.

Exception from HRESULT: 0x80041050

Now when we also try to upload documents, it does not allow us to upload the documents and reports a exception.

We tried to research through through the error, it gaves us while downloading the document, it is somewhat related to the Antivirus issues and looks like a document that is infected. This is only related to some documents and not all documents.


Let us know if there is any where to work around this issue and allow users to upload and download documents or how to tackle the antivirus issue.


It looks like the SharePoint antivirus has flagged off some of the so-called infected documents with some non-zero values, the resolution to this as suggested by microsoft is to re-run the anti-virus, so that the document value can be set to zero again and have the file downloaded.

Your help will be highly appreciated in this regards.







Question about Workflow in Document Library with version control and check-in/out enabled



I use Sharepoint Foundation 2010 and have a workflow to set some metadata in a document with version control and check-in/check-out enabled (approval content is not enabled because anyone in the team can be a possible editor of the document).

My metadata is:

- a generated doc id with text+id (example P&D_1)

- a calculated status based in version: minor version = "on development" and major-version="published/approved"

I defined two workflows:

1) is called when item is created to define id and status.

2) is called when item is updated and status is re-calculated if version is major. (It is called in every item change, not only when user wants to publish a major version, because this option doesn't appear in SPD)

I noticed that sharepoint workflow must do a check-out to be able to update metadata, and because of this the version number is incremented. When version is minor, I don't care, but when version is major I have a problem, because just after publishing the version 1.0, the workflow changes metadata and the version to 1.1. and 1.1 means that the document is not approved anymore...


a) Isn't it possible to do the workflow to check-in and override the last/current version to not generate a new version??

b) Or is it possible to stop versi

Getting error msg while trying to upload a document inot the document library using the form which i


I have designed an upload form with the columns that have to be filled in while uploading a document into the document library.The form is designed in .net.

I get "Error Access Denied" message when i try to upload the document using that upload form.When i go back to site,the document is uploaded in that particular document library.But this problem doesnot exist when i upload the document as admin.There is no " Error Access Denied" message.I have checked the document library permissions.The problem is not with the permission to that particular document library.

Can someone help me out in this issue?

2010 SharePoint global setting for document Library version control?


Apparently new Document Libraries created in Sharepoint are no longer set up the way we would like as far as version control.  Is there any way to set up SP so that any new document library created has specific settings, through Central admin control?

Jack Galante Sr Systems Engineer

i do see that previous versions this was not possible, but was curious if they changed this in 2010?

Delete document library throws "Exception from HRESULT: 0x80040E14" error


I am running WSS 3.0 SP2 running the Feb 2010 cumulative update. I have a particular document library I am attempting to delete. When I click on delete in the GUI, I get a page that says "Exception from HRESULT: 0x80040E14". Everything I've found so far on the web says this is caused by a SQL server that is out of space. That is not the problem in my case.

Additionally, I have looked at the logs in Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS and found the root cause. When I try to delete this document library, two errors are added to the log. They are

  • 06/16/2010 09:45:55.72     w3wp.exe (0x1798)                           0x0D44    Windows SharePoint Services       Database                          6f8g    Unexpected    Unexpected query execution failure, error code 8144. Additional error information from SQL Server is included below. "Procedure or function proc_SecGetI

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

WebResource.axd error on Document library with group by display



I'm currently experiencing an error when accessing our SharePoint Extranet site.  When accessing it on a public network and browsing to this document library, when trying to expand the group by categories, IE spits out an error that reads:

Errors on this webpage might cause it to work incorrectly.

Access is denied
Line: 85 Char:9 Code:0
URI: url path to our external address, followed by WebResource.axd+numbers/letters

This error does not occur when hitting the site internally.  Any guesses on what is causing this and what can be done to correct it?


Creating a new document library - Unknown error


when creating a new document library on our site, we get an unknown error

the libraries create fine on the subsites just not on the top level sites.

Sharepoint Customiser

Error when providing email setting into document library setting.



I am trying to create Email enable SharePoint Lists and Libraries so users can send an email directly to it. This is a great functionality for users to be able to contribute directly from their inboxes.

I am following this video


I am using SharePoint 2007.

I have configured Incoming email setting in Central Administration->Operations.

After this I have used Shared Document. I went to Setting of Shared Document Library.
Then I set options like:

Allow this document library to receive e-mail?  -> Yes
Email Address : shareddoc@sharepoint.local.com
Group attachments in folders?  -> Save all attachments in folders grouped by e-mail sender
Overwrite files with the same name? -> No
Save original e-mail? -> No
Save meeting invitations?  -> No
E-mail security policy: -> Accept e-mail messages based on document library permissions

After providing this setting, I clicked on OK button and I got an error :
Error in the application.

I checked Log file and event viewer also, but there is not entry fou

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