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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to get FileTicket knowing File Id ?How to get FileTicket knowing File Id ?
Previous
 
Next
New Post
11/16/2010 4:18 PM
 
Hi everyone,

Currently I'm doing some changes to the Filemanager module and stuck with the problem of getting fileticket for the uploaded file. Whta I'm trying to do:

when I upload new file into the folder I need to get all users who have permission to view the folder and its files and notify them by email that new file was uploaded. In the email I need to send them a link to the file. The link contains LinkClick.aspx with file ticket. So I have a question, is tehre any way to get / generate fileticket for the uploaded file (I see its already in database), Fileticket doesn't use FileId, the url looks like that:
/LinkClick.aspx?fileticket=_klRq-yzGAk%3d

So the question is: How can I get fileticket? Thanks in advance.
 
New Post
11/16/2010 7:54 PM
 
Use LinkClick Function. It requires the FileID

DotNetNuke.Common.Globals.LinkClick("FileID=" + FileId.ToString(), TabId, ModuleId,false)

Mandeep Singh
CEO - Mandeeps.com | Developing DotNetNuke Modules Since 2004
DNN Monitor | DotNetNuke Keep Alive Service
 
New Post
11/16/2010 8:43 PM
 
Mandeep Singh wrote:
Use LinkClick Function. It requires the FileID

DotNetNuke.Common.Globals.LinkClick("FileID=" + FileId.ToString(), TabId, ModuleId,false)

 Thanks for that function. I think it's exectly what I need. But I have question, it takes 3 arguments:
public static string LinkClick(string Link, int TabID, int ModuleID);

What values should I put for TabId and ModuleId if I want send link to the uploaded file be email?

 
New Post
11/17/2010 1:30 AM
 
I'm pretty sure if you put in -1 for tabid/moduleid then it doesn't output them onto the link. You can experiment to check. At either rate, it doesn't really matter, the tabid/moduleid is just for the link tracking, if you're using it.
 
New Post
3/22/2011 10:45 PM
 
Hi all,
Thanks Mandeep and Bruce for your help.  I work with Vasily, and this does indeed work for people who are logged in and in the role(s) with permission to view files in that folder, but instead of prompting to login for anyone not logged in or not in the role, DNN simply throws an error.  the error is a 404 - not found.

Any ideas why this is?
the code used above gets a good linkclick and fileticket, eg:
http://www.nzalpa.org.nz/LinkClick.aspx?fileticket=BaPLZl3y-FI%3d
but you will see if you try follow that link you'll get a generic error, whereas I get to see the file (when logged in).
when creating links to the same file in the Text/HTML module it does exactly the same thing, errors rather than presenting us with the login page!

I'm sure that DNN's LinkClick.aspx page used to / is supposed to prompt login when permissions deny the link, but this doesn't seem to be working for us.  is it a know bug or something to do with our set up I wonder?

Any ideas how to fix this?

Thanks in advance.
Tim

NetPotential
Web Design Auckland: www.netpotential.co.nz
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to get FileTicket knowing File Id ?How to get FileTicket knowing File Id ?


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