Posts Tagged ‘Sharepoint’

SP - Uploading files to SharePoint document library

here we go, just some simple upload code that uploads documents into a document library.
It also checks if the same file exist in the destination library before upload.

SPSite site = new SPSite(”http://mysharepointsite”);
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates = true; // i always add this in to prevent security errors
Stream fStream = postedFile.InputStream;
byte[] contents = new byte[fStream.Length];
fStream.Read(contents, [...]

Comments (5)

SharePoint application logs massive!!

After doing some development/webpart work on our sharepoint server, the log file to grew to 3.5GB - we have 0.99MB of free space of a 20GB disk (this is a dev/test Virtual server).
Anyway after searching, i came across this blog: http://blogs.vertigo.com/personal/steventap/Blog/archive/2007/01/19/managing-sharepoint-2007-moss-application-log-size.aspx - thanks Steven!
Apparently you can manage how SharePoint logs it’s events:
The Problem:
SharePoint 2007 by default stores 48 [...]

Comments (2)

Sharepoint - Unknown Error has occurred

I too have dreaded this error - it means nothing to me and just pisses me off especially when developing webparts.
You can remove this by opening the web.config,
Search for <customErrors mode=“On“ /> and change it to <customErrors mode=“Off“ />
To see the call stack and trace information. Find
<SafeMode MaxControls=“200” CallStack=“false” DirectFileDependencies=“10” TotalFileDependencies=“50” AllowPageLevelTrace=“false“>
and change [...]

Comments (3)

Backing Up Sharepoint & ZIP (compress)

Hi All,
I want to publish the backup script i use to backup sharepoint every night. It is a very basic BATCH script (.bat) which uses STSADM sharepoint command line tool to backup sharepoint then uses winrar to zip and compress the file in date format then copy to the destination drive. 

# setting a the variable stsadm as [...]

Comments (1)

Sharepoint - EventID: 17137

You recieve the event (17137) in the eventlog when you migrate the databases to a different disk or partition (in this case i moved it to a different partition).
The description for Event ID ( 17137 ) in Source ( MSSQL$MICROSOFT##SSEE ) cannot be found. The local computer may not have the necessary registry information or message [...]

Leave a Comment