Products

Solutions

Resources

Partners

Community

About

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...Getting StartedGetting Startedusing the filepickeruploader controlusing the filepickeruploader control
Previous
 
Next
New Post
4/30/2014 1:57 PM
 

Hello,

I am trying to use the filepickeruploader control.

I have it basically working, please see the code below which I modified from the DNN source code.

It adds a folder if one doesn't exist, allows a file to be selected and uploads it.

But I have some parameters (one of which is the moduleid) stored on the client which I'd like to associate with that file for further processing on the server.

Is there any way to do that? For example, If I could rename the uploaded file from say 'somefilename.png' to '[ModuleID]_somefilename.png', that would allow me to process the file server side.

The other possibility, would be to send the file to a more specific directory. For example:

SomeDirectoryPath/[ModuleID]/[SomeOtherField]

Again, the path would need to be set on the client side. I tried changing the filepickeruploader control to allow the path to be entered into the file path combobox directory, but that didn't work. presumably because the directory path isn't registered on the server side. But I don't want to have to enter every possible path on the server side.

Best Regards,

Steve


var userControl = Page.LoadControl("~/controls/filepickeruploader.ascx");

DotNetNuke.Web.UI.WebControls.DnnFilePickerUploader _fileControl

= userControl as DotNetNuke.Web.UI.WebControls.DnnFilePickerUploader;



string ImagePath = "DesktopModules/FlexiContent/images/";



DotNetNuke.Services.FileSystem.IFolderInfo f = DotNetNuke.Services.FileSystem.FolderManager.Instance.GetFolder(PortalId, ImagePath);

//DotNetNuke.Services.FileSystem.FolderManager.Instance.DeleteFolder(f);

f = DotNetNuke.Services.FileSystem.FolderManager.Instance.GetFolder(PortalId, ImagePath);

if (f == null)

{

DotNetNuke.Services.FileSystem.FolderManager.Instance.AddFolder(this.PortalId, ImagePath);

}



                



                _fileControl.FolderPath = ImagePath;

_fileControl.FilePath = ImagePath;



//_fileControl.ID = thisTarget;

_fileControl.FileFilter = "jpg,jpeg,gif,png";

_fileControl.EnableViewState = true;

_fileControl.ViewStateMode = ViewStateMode.Enabled;

//_fileControl.UsePersonalFolder = false;

_fileControl.User = null;



FileUploadPlaceHolder.Controls.Add(_fileControl);

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting Startedusing the filepickeruploader controlusing the filepickeruploader 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