Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  file upload process
Previous Previous
 
Next Next
New Post 5/12/2008 6:58 AM
User is offline SupaHoopsa
59 posts
www.hrgworldwide.com
10th Ranked


file upload process 

In the settings of a new module I am creating, I would like the user to be able to upload an image file of their choice to act as a form of icon,

I would like this to work in the same way that an admin user can upload an image to use as a site header in the admin>settings page.

What I don;t want to have to do is re-invent the wheel. The code used in the settings page would do the job for me, but even though I have downloaded the entire source code, I can't find this page so that I can review the code.

Is there a simple DNN function already available that I can use to upload files?

Is there an example available on how to do this?

 
New Post 5/12/2008 11:53 AM
User is offline Mitch Sellers
5372 posts
www.mitchelsellers.com
3rd Ranked




Re: file upload process 

You can use the DNN UrlControl to handle the file upload, this is the control that you see on the Site Settings page for the logo.


-Mitchel Sellers
MCITP, MCPD, MCTS
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 Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
New Post 5/21/2008 9:12 AM
User is offline SupaHoopsa
59 posts
www.hrgworldwide.com
10th Ranked


Re: file upload process 

Thanks Mitch, I got the upload working.

 

However I now have another problem and that is getting the virtual path of the file that has been uploaded so that I can display it in my module.

I store the file id (38) and I use the

DotNetNuke.Services.FileSystem.FileController.GetFileById(HRGi.ImageID, PortalId)

to populate a DotNetNuke.Services.FileSystem.FileInfo object

BUT this fileinfo object only gives the Physical path:

?objFileInfo

{DotNetNuke.Services.FileSystem.FileInfo}

ContentType: "image/gif"

Extension: "gif"

FileId: 38

FileName: "newspaper.gif"

Folder: ""

FolderId: 16

Height: 114

IsCached: False

PhysicalPath: "C:\DotNetNuke Sites\DNN_481\Portals\0\newspaper.gif"

PortalId: 0

Size: 12428

StorageLocation: 0

Width: 114

 

Any idea's how I get the virtual path from the FileID, so that I can display the uploaded image within my module?

 
New Post 5/22/2008 8:27 AM
User is offline Mitch Sellers
5372 posts
www.mitchelsellers.com
3rd Ranked




Re: file upload process 

You should be able to pass the path value to the ResolveClientUrl method to get the link.  Now you have to be careful though that the file isn't in a secured folder.


-Mitchel Sellers
MCITP, MCPD, MCTS
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 Consulting Quotes, and DNN Technical Support Services

I reccomend 3Essentials for shared hosting and BaseCamp for project management
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  file upload process
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Web Development and Strategy Firm
The Risdall Interactive Agency s websites, strategies, branding, & promotion in digital space.
www.Risdall.net/
Windsor Management Group
Fund Accounting Software for K12 Education.
Infinitevisions.com
Convert Visitors to Customers
In order to bring value to your users, we must first understand them. VIVIDSITES will help you build a custom web application and interactive marketing tools that your users will thank you for. We marry high-end creative with head banging technology to entertain and convert visitors into paying customers. Call 314.514.0505 or visit us at http://www.vividsites.com to find out how.
- V I V I D S I T E S -

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP