Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryE-mail notification on download?E-mail notification on download?
Previous
 
Next
New Post
5/25/2007 10:19 PM
 

DNN newbie here... I need the capability to have the uploader of a file notified whenever someone downloads that file.  Any way to accomplish that in Repository; or is there a 3rd-party module I could buy which has that capability?  TIA for any assistance on this!

 
New Post
6/1/2007 10:57 AM
 

 I  also was trying to find out how to implement this function; unfortunately I have got only one suggestion, which is to write a custom module that handles the desired functionality. Since download/linking functionality included in the documents module is actually functionality that is provided by a Core DNN control that is used by other modules it is not recommended to modify the existing as it could/would cause problems with other modules. I am also a newbie to DNN, i suppose it would take a long time to accomplish that.
Another possibility is to use the documents module to link to your files, here you have the option of selecting "Log the user, date, and time for every link click".  This will keep track of all downloads, and you can view the information at any time via the website, however, on that exact page you only see the username.
If you have any suggestions or experience in this please advice.

 
New Post
6/1/2007 2:29 PM
 

The repository module actually handles downloads on it's own.  I would guess that you could modify the code that displays the item for download to include an e-mail notification.

 


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
6/1/2007 3:13 PM
 

The change to the Repository source would be very minor ...

Assuming you have DNN 3.X and the Repository module installed, unzip the source code into the /DesktopModules/Repository folder and load up the DotNetNuke.Repository.sln solution file in Visual Studio 2003.

edit Repository.ascx.vb and look for the following code...

Case "Download"
  IncrementDownloads(e.CommandArgument)
  Dim target As String = oRepositoryBusinessController.GetSkinAttribute(xmlDoc, "DOWNLOAD", "Target", "NEW")
  oRepositoryBusinessController.DownloadFile(e.CommandArgument, target)

this code handles the download event, increments the download count, then calls the business controller to download the file. All you'd need to do is add a couple of lines of code after the download to send an email ( adding the code in blue )

Case "Download"
  IncrementDownloads(e.CommandArgument)
  Dim target As String = oRepositoryBusinessController.GetSkinAttribute(xmlDoc, "DOWNLOAD", "Target", "NEW")
  oRepositoryBusinessController.DownloadFile(e.CommandArgument, target)
  ' get portal settings so you can get the admin's email address
  Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)
  ' construct your email body
  Dim strBody as string = "On " & Date.Now() & " " & UserInfo.DisplayName & " downloaded " & objRepository.Filename
  ' send the email to the original author
  DotNetNuke.Services.Mail.Mail.SendMail(_portalSettings.Email, objRepository.AuthorEmail, _
    "", "", Services.Mail.MailPriority.Normal, "Someone has downloaded your File", _
    Services.Mail.MailFormat.Text, System.Text.Encoding.Default, strBody, "", "", "", "", "")

Compile and test within Visual Studio to make sure it's working properly. Then re-compile one last time in Release mode. Then exit Visual Studio.

To re-package: Run the /DesktopModules/Repository/DotNetNuke.Repository.build batch file ( requires that you have NANT installed )

Look in the /DesktopModules/Repository/package folder and you'll see a new Install .zip that you can then use to install your new Repository module on any DotNetNuke installation, either 3.X or 4.X

 
New Post
6/5/2007 5:07 AM
 

Many thanks for the reply and advices. i will try to implement it.

Is the procedure similar if i wanted to do the same also for the "Documents" module?

The "Documents" module has the option of selecting "Log the user, date, and time for every link click" and then displaying the log ("Display" ), is it possible to have the same user controls also for the "Repository" module?

thankful,

Audrius

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryE-mail notification on download?E-mail notification on download?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out