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  |  

DotNetNuke Marketplace
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Func DownloadFile() in FileSystemUtils
Previous Previous
 
Next Next
New Post 6/1/2006 2:38 AM
User is offline sumayah1421 sumayah1421
20 posts
10th Ranked


Func DownloadFile() in FileSystemUtils 

Hi every one,

bear with me please..

I’m coding a products catalog in DNN4 and would like to provide pdf manuals for the products.

The manuals are stored on the file system in the "Portals" folder

At the moment they are hyperlink with the URL as "~/Portals/0/pdftest.pdf"

But when clicked, of course, the pdfs are opened in the browser automatically which is not what I want.

I want to provide the user with that pop up window requesting the option of either open,save or cancel.

I know this is related to file handling in the System.IO.Stream.

But there is a func the file manager in DNN already uses, so why not make use of it.

I tried calling it using the following:

FileSystemUtils.DownloadFile("~/Portals/0/pdftest.pdf"); à nothing happens, just the page refreshs.

FileSystemUtils.DownloadFile("/Portals/0/pdftest.pdf"); à nothing happens, just the page refreshs.

FileSystemUtils.DownloadFile("website/Portals/0/pdftest.pdf"); ànothing happens, just the page refreshs.

 

FileSystemUtils.DownloadFile("http://127.0.0.1/DotNetNuke Website/portals/0/pdftest.pdf"); àgot an error "URI formats are not supported.".

I have a feeling that it is something with the the file path,because the func is working ok from the file manager.

If not, does any one have a ready made code for what I want?

Any help is greatly apreciated,

Thank you

 
New Post 6/1/2006 7:19 AM
User is offline Steve Fabian
1500 posts
5th Ranked








Re: Func DownloadFile() in FileSystemUtils 

DownloadFile() expects a file system full path, not a URL, so the following should work

FileSystemUtils.DownloadFile(Server.MapPath("~/Portals/0/pdftest.pdf"));

Steve Fabian
Gooddogs.com
Sit, Stay, Code ... Good boy!
 
New Post 6/2/2006 9:50 AM
User is offline sumayah1421 sumayah1421
20 posts
10th Ranked


Re: Func DownloadFile() in FileSystemUtils 

That did it,

Thank you

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Func DownloadFile() in FileSystemUtils
 


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.

 


IHostASP.NET Provides the Ideal DNN Hosting
We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
www.ihostasp.net
$7.16/mo - Powerful DotNetNuke / DNN Hosting
Powerful DotNetNuke / DNN Hosting on Windows 2008 and 2003 servers, starting at under $8/mo with FREE SQL 2008 on certain plans and FREE SQL 2005 on all plans with FREE Installation and expert support.
www.re-invent.com
ASP.NET Web Hosting for $3.95
3 Month FREE ASP.NET Hosting! FREE Setup! DNN Support! FREE Domain Name! FREE Components! Host multiple websites on 1 plan! 30 Days Money Back Guarantee!
www.dailyrazor.com

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