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  |  

Affordable ASP.NET Hosting Service
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


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
1516 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.

 


Need Help with your DotNetNuke website?
Jango Studios offers exclusive DotNetNuke Skin Design, Module Development, Web Marketing and Web Hosting.
www.jangostudios.net
Where Every Home is an Investment
Where Every Home is an Investment
www.nestbrokers.com
Faculty of Graduate and Postdoctoral Studies
At the graduate level, the University of Ottawa offers more than 180 graduate certificates, master's degrees and PhDs, as well as interdisciplinary programs such as Women's Studies and Canadian Studies. Many postdoctoral opportunities are available in both the sciences and the humanities. For further information, please consult the site of the Faculty of Graduate and Postdoctoral Studies.
www.grad.uottawa.ca

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