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...Getting StartedGetting StartedProgramatically adding Files to a portalProgramatically adding Files to a portal
Previous
 
Next
New Post
7/26/2010 12:33 PM
 
I'm relatively new to DNN and finding the API quite overwhelming at the moment. I'm using the basic document module to allow a file download interface (the site is all about downloading files - pretty much every page is just a file download with a selection of files available in it). Now my problem comes that the initial setup of the site includes adding several thousand files (there are 50 clients each with their own versions of files). I obviously dont' want to go and upload these individually and while I do have the option to upload them as a zip file to make life a bit easier I'd still need to set security and so on on the files. So I was wondering if anybody can point me to the appropriate part of the API to do file uploads and settign file permissions. I reckon if needed the database structure looks simple enough to do it directly but the whole point of an API is that I shouldn't be poking around in the database. :)

Also if anybody can tell me a way of programatically adding files to the document module once the files are in the system that'd be good too. :)

Thanks very much for your help.

Chris
 
New Post
7/26/2010 1:53 PM
 
Chris,

Security is setup on a folder by folder basis, so what I'd recommend is something like this.

1.) Create the folders and permissions via the File Manager
2.) FTP the files to the folder
3.) Synchronize the file system

Using this process you are simple, and no custom coding is needed.

-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
7/27/2010 4:36 AM
 
Ah, I had seen the synchronize. That makes sense. Is there any way to get the sync to be called programatically? I want to be able to automatically put the files there and then automatically have them sync if possible... I found DotNetNuke.Services.FileSystem.SynchronizeFileSystem but it seems to be intended to be used as part of the scheduler system which I've not looked at and sounds a bit scary. I saw advice on http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/181/dotnetnuke-scheduler-explained.aspx that said don't run the sync scheduler if you have a big file system since it will take a long time... I could go digging into the file manager and try to work out what gets run when you click on the sync but was hoping somebody would just know and save me the effort. :)

P.S. Thanks for the help. And for having a good website that I'll have to browse later for other useful info. :)
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedProgramatically adding Files to a portalProgramatically adding Files to a portal


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