.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

Send email when downloading a file from a document library

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#

I'm setting up a public facing SharePoint site for my company, a software house (did I show my age by calling it that?). We're wanting to put together a list of of software downloads, each item on the list having configured permissions for different groups (such as Group A can see downloads 1 thru 3, Group B can see items 1- 5, and Group C can see all 10 items)

When a logged in group member downloads the file (Send To > Download a copy) or by clicking the litem name, I want to send that person an email, which will contain setup instructions and unlock passwords, etc.

How can this be done?

I've googled and googled, but not been able to find any clues, which is a little unnerving.

A true software developer is one who, when told to 'Go to Hell', sees the 'go to', rather than the destination, as harmful.

View Complete Post

More Related Resource Links

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




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

Sharepoint Workflow To Shoot Email Only When Folder Is Created In Document Library

Hi, Can anyone help me with the below issue, I am facing this from so long and didn’t figure out solution yet for the same. :( I want to send an email through SharePoint designer workflow only when a folder is created in document library (not file uploaded/updated event). Please provide me solution about how I can achieve this through SharePoint designer as don’t have enough coding acquaintance.

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  

Customizing Send To Other Location Functionality for a document library item in Moss 2007

Hi All i have a requirment to customize the Send To Other Location funtionality. while using OOTB Send to Other Location option for a document library item we have  selection like Prompt the author to send out updates when the document is checked in? <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateYes" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes">Yes</label> <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo" checked="checked" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateNo" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo">No</label> how we can set this option in my custom coding based on the user selection. i am not able to understand the functionality of the above option. can any one please explain the above option and let me know how to set this option programmtically in my custom code.   Thanks in Advance  muthu

Send a csv file by email without saving it first

The following code pulls data from a table writes it to a csv file and then prompts a user to open or save the file. What I need to do is pull the data to the csv file and send it to a predetermined email address, without prompting the user or saving it. How can I do this? Dim MySQL As String = "" MySQL = "SELECT TOP 1 * FROM [tblSurvey] ORDER BY SurveyID DESC" Dim MyConn As New SqlConnection(ConnectStr) Dim cmd As New SqlCommand _ (MySQL, MyConn) 'Set the appropriate ContentType. Dim filename As String = "Data_" & txtName.Text & "_" & System.DateTime.Now & ".txt" cmd.CommandType = CommandType.Text cmd.Connection.Open() Dim myReader As SqlDataReader = _ cmd.ExecuteReader _ (CommandBehavior.CloseConnection) Dim i As Integer Dim sb As New System.Text.StringBuilder For i = 0 To myReader.FieldCount - 1 If i < (myReader.FieldCount - 1) Then sb.Append(myReader.GetName(i) & Chr(9)) Else sb.Append(myReader.GetName(i) & vbCrLf) End If Next While myReader.Read() For i = 0 To myReader.FieldC

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!    

Unable to filter the "E-mail To" field in email enabled document library

Hi, We have setup a few email enabled docuement libraries to store emails relating to project work. Is there a way to make the "E-mail To" field in the library be filtered? It is greyed out and doesnt give you the option. The "E-mail From" and "E-mail Subject" are able to have a filter applied to them but for some reason the "E-mail To" field wont let you filter the content. The probelm is that there are over 500 files in the library and the easiest way to find messages is to be able ot filter this column in the library if it is at all possible.

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