Sunday, December 16, 2012

The specified file is larger than the maximum supported file size.

Hi All,

We got the below error when trying to upload a file of size 1GB in document library.

"The specified file is larger than the maximum supported file size."
















SharePoint 2010 by default allows file size upto 50MB. However, we can change this setting by few simple steps.

1. Select the web application and click General settings








2. We have a setting called Maximum Upload size. This is set to 50MB by default as shown below. Change it to the size as per your requirement and you are good to go!








Tuesday, November 6, 2012

WebPart Maintenance Page in SharePoint

Hi All,

WebPart Maintenance page is used to close Web Parts on your page, restore defaults to Web Parts, or delete Web Parts from your page.

To go to this page, just type contents=1 in query string.

Example: http://sp2007/default.aspx?contents=1

WebPart Maintenance Page screen:












We can close, delete the webparts by just selecting them using checkbox.

Thank you !

Wednesday, September 5, 2012

Cannot make a cache safe URL for "styles/~/SampleProject/StyleSheet.css", file not found. Please verify that the file exists under the layouts directory.

Hi All,

While trying to register a CSS file in SharePoint using CSSRegistration class as:

// Register CSS File
CssRegistration.Register("~/_layouts/SampleProject/StyleSheet.css");

We got the following error:

"Cannot make a cache safe URL for "styles/~/SampleProject/StyleSheet.css", file not found. Please verify that the file exists under the layouts directory".






One of the benefits of using SharePoint:CSSRegistration is that it prevents multiple loading of same CSS file. For Example, if we try to register a CSS file multiple times as:


// Register CSS File
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");

The final rendered Page will have only one instance of this style sheet.

Ok. Coming back to the problem, the Resolution is to remove ~ in the URL. Hence, the correct statement would be:


// Register CSS File
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");

Here is a good source to know more about SharePoint:CSSRegistration:
http://tommdaly.wordpress.com/2012/05/02/sharepoint-cssregistration-or-link/

Thanks !