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 ExtensionsModulesModulesFilePickerUploader Usage?FilePickerUploader Usage?
Previous
 
Next
New Post
1/20/2014 8:30 PM
 

How can I use the FilePickerUploader in a custom module?

I've tried setting the .FileID to the file and I've tried setting the FilePath, but nothing seems to work.  Can someone give me an example?

 
New Post
1/22/2014 1:38 PM
 
<%@ Register TagPrefix="dnn" TagName="FilePickerUploader" Src="~/controls/filepickeruploader.ascx" %>


and then setting the properties in the codebehind (or declaratively) e.g.
ctlBackground.FilePath = portal.BackgroundFile;
ctlBackground.FileFilter = Globals.glbImageFileTypes;

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/22/2014 2:38 PM
 
I'm still having troubles. Here's my example:

In my database table I have a string field name "ImageFileNo". I have set the value to "FileID=25". When I load the record from the file and extract the "ImageFileNo" value and parse out the integer value 25. I then set the ctlBackground.FileID = 25, but I'm still not seeing the image at runtime and the path doesn't change either. Any ideas?


<%@ Register TagPrefix="dnn" TagName="FilePickerUploader" Src="~/controls/filepickeruploader.ascx" %>

ctlBackground.FilePath = portal.BackgroundFile;
ctlBackground.FileFilter = Globals.glbImageFileTypes;
ctlBackground.FileID = 25;
 
New Post
1/23/2014 11:01 AM
 
I checked the platform and can't find an example of what you're doing -the code looks mostly fine in that it accepts the parameters, and I can see logic loading the folders and files - however it seems to be (without debugging) that the fileid usage is wrong - it's only applied when the value is set, but should also be used when the initial load occurs. I'd suggest logging this as a bug to support.dnnsoftware.com so someone can actually debug and confirm (and fix) the issue

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/23/2014 6:21 PM
 
There are a number of issues with using the file picker in your own custom controls - in our experience we have found that its NOT a module that you should try to drop directly onto a .ascx file as a control.

Part of the reason for this - is that the control actual instantiates other controls inside itself BEFORE you are able to set some of the properties yourself,

Drop a placeholder control on you ascx page - thisPlaceHolder:

var userControl = Page.LoadControl("~/controls/filepickeruploader.ascx");
            DotNetNuke.Web.UI.WebControls.DnnFilePickerUploader _fileControl = userControl as DotNetNuke.Web.UI.WebControls.DnnFilePickerUploader;

            if (_fileControl != null)
            {
                _fileControl.ID = thisTarget;
                //     _fileControl.FileFilter = "jpg,jpeg,gif,png";
                _fileControl.FileFilter = thisFileFilter;

                _fileControl.UsePersonalFolder = true;
                _fileControl.User = thisUser;

                if (!Page.IsPostBack)
                {
                    _fileControl.FilePath = filePath;
                    _fileControl.FileID = thisValue;
                }
                //Add table to Control

                thisPlaceHolder.Controls.Add(_fileControl);

            }

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesFilePickerUploader Usage?FilePickerUploader Usage?


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out