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 ForumsDocumentsDocumentsUse of portal:url controlUse of portal:url control
Previous
 
Next
New Post
5/17/2007 4:40 AM
 

I am a very beginner of DNN and am trying to create a module using the portal:url control. I have a couple of easy questions (not for me):

1) Speficying an existing File (URLType=F) I get URL="FileID=20"

how do I get the file in order to use it in the module?  How do I get the file name corrsponding to FileID=20 ?

2) How is it possible not to show the details like Track Number, Log the users Open Link...  ?

Thanks

Alessandro

 
New Post
2/12/2008 10:18 AM
 

Hi Alessandro,

To the first question, here is my answer: you should catch the url coming out of the urlControl and format it before storing it to the database. I resolved this way:

Dim ImageUrl As String = ""
Select Case MyUrlControl.UrlType
  Case "F"
    Dim ImageFileId As Integer = Integer.Parse(MyUrlControl.Url.Substring(7))
    Dim objFileController As New FileController
    Dim objImageInfo As DotNetNuke.Services.FileSystem.FileInfo = objFileController.GetFileById(ImageFileId, PortalId)
    ImageUrl = PortalSettings.HomeDirectory & objImageInfo.Folder & objImageInfo.FileName
  Case "U"
    ImageUrl = urlImage.Url
End Select

In addition, check this post:

http://forums.asp.net/p/873170/986848.aspx

Answering the second question, you can manage it in your control.ascx file with:

<dnn:URL ID="MyUrlControl" runat="server" FileFilter=".jpg,.gif"
            ShowFiles="true" ShowTrack="false" ShowLog="false" />

Hope it helps,

Dario Rossa.

 
New Post
2/13/2008 10:20 AM
 

Another option to get the file path, to avoid the direct file path is to use the following method.

DotNetNuke.Common.

Globals.LinkClick("FileId=20", this.TabId, this.ModuleId)


-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/7/2008 7:48 PM
 

FWIW, I know this is a bit of an older post but I just implemented this on my page and URLControl seems to not work with multiple values in the FileFilter when uploading. I'm on DNN 4.8.3 and couldn't upload a file with it until I had filefilter only showing 'jpg'. Which in my case is fine, but really just annoying to figure out.

 
New Post
7/21/2008 11:04 PM
 

Hey there toadkicker - you can use FileFilter="jpg,bmp,gif,jpeg,png"  to have multiple files -- just make sure there are not any spaces in between. Also, when I'm doing multiple extensions, I don't use the "." on the extension..not sure if it will accept it or not, but it works for me. I do have a single FileFilter using a . with the extension however. Hope that helps fix your annoyance.

 

 


Check out the open source DNN Testimonials project on CodePlex and help build it!
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsDocumentsDocumentsUse of portal:url controlUse of portal:url control


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