if you want to block .doc and .docx files for all the document libraries in sharepoitn site.. Go to central admin and add these two file extensions as blocked file type for your site collection...
If you want to block .doc and .docx file only for one document library than write a custom event handler on itemAdding and check for the file extension if extension is .doc or .docx cancel teh event ............
Slideshow+ V2.5 Released with Support for Uploading Slideshow Video to Facebook and YouTube
Now Christmas Day is coming.Here is a gift of Slideshow+ code on iTunes for you: R3FLKKYHJ77R . If you like it you can receive Slideshow+ in http://itunes.apple.com/us/app/slideshow/id462690585?ls=1&mt=8
Since my friend is from HR department I need suggestions from technical friends..So friends please help me out with my doubt.
Do you mean attachments (aka attach files to an external sharepoint site)? If so here is a code that should do the trick for you:
WebClient loClient = new WebClient();
loClient.Credentials = new NetworkCredential(Utility.GetConfigKey("SharePoint ACCOUNT"), Utility.GetConfigKey("SP Account Password"), "Domain Name");
byte myDataBuffer = loClient.DownloadData(new Uri(Utility.GetConfigKey("SharePoint URL") + lsFileName));
// Clear all content output from the buffer stream
// Add a HTTP header to the output stream that specifies the default filename// for the browser's download dialog
Response.AddHeader("Content-Disposition", "attachment; filename=" + lsFileName);
// Add a HTTP header to the output stream that contains the// content length(File Size). This lets the browser know how much data is being transfered
// Set the HTTP MIME type of the output stream
Response.ContentType = "application/octet-stream";
// Write the data out to the client.
lblFormError.Text = "Unable to add document to sharepoint list location";
Last Visit: 25-Sep-20 16:29 Last Update: 25-Sep-20 16:29