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  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
FCKeditor Project
Salaro -- Skins and more
 


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
51 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
5028 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
Director of Development
IowaComputerGurus Inc.
View Mitchel Sellers's profile on LinkedIn

Visit mitchelsellers.com for DotNetNuke tutorials, modules and technical help

Custom DotNetNuke Services Available (Development, etc).

My sites are hosted with 3Essentials
 
New Post 5/21/2008 9:12 AM
User is offline SupaHoopsa
51 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
5028 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
Director of Development
IowaComputerGurus Inc.
View Mitchel Sellers's profile on LinkedIn

Visit mitchelsellers.com for DotNetNuke tutorials, modules and technical help

Custom DotNetNuke Services Available (Development, etc).

My sites are hosted with 3Essentials
 
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.

 


Disgrafic
Diseño y creación de portales web dinámicos :: Desarrollo de módulos personalizados :: Soluciones a medida :: Imagen Corporativa :: Tu proveedor DNN en España
www.disgrafic.com
DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com
Integral Hosting | DNN only $14.95/month
Experienced .NET hosting on Windows 2003, ASP.NET 1.1 & 2.0, MSSQL with real technical support.
www.integralhosting.com

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