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...Building ExtensionsBuilding ExtensionsModulesModulesAlternative for deprecated functions in FileSystemUtils.csAlternative for deprecated functions in FileSystemUtils.cs
Previous
 
Next
New Post
11/20/2012 5:30 AM
 

Hi,

I'm using a lot some functions in the FileSystemUtils.cs library.  Now in DNN6 when I compile my module I notice they are deprecated.

Can anybody tell me what's the best alternative for:

DotNetNuke.Common.Utilities.FileSystemUtils.GetContentType("pdf")

and 

DotNetNuke.Common.Utilities.FileSystemUtils.WriteFile(objFile.FullName)

?

I tried using the code I found in https://dotnetnuke.svn.codeplex.com/svn/trunk/Community/Library/Common/Utilities/FileSystemUtils.cs but this did not work because of the protection level of the new functions.

Thanks for your time.

Olivier Jooris


 
New Post
11/20/2012 11:18 AM
 
Olivier,

new DotNetNuke.Services.FileSystem.FileManager().GetContentType("pdf")

and

new DotNetNuke.Services.FileSystem.FileManager().WriteFile(objFile.FullName);

Hope this is correct and helps...

Best wishes
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
11/28/2012 4:43 AM
 

Hi Michael,

I already tried this, but got a compile error:

I'm not sure how to solve this?

Any Idea?

 
New Post
11/28/2012 4:46 AM
 

By the way, this is not called from a DNN module, but from a regular aspx page within the dnn system  (to prevent the menu and skin from being loaded)

Imports System.IO
Imports DotNetNuke.Security
Imports SANAL.sanal_shared
Imports DotNetNuke.Common.Utilities


Partial Class popupfile
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

.....

 
New Post
11/28/2012 8:10 AM
 

The FolderManager and FileManager API is designed as a abstract providers. You do not need to (and cannot since their constructors are marked internal) use new to instantiate a FolderManager of FileManager object. Instead do the following:

objResponse.ContentType = DotNetNuke.Services.FileSystem.FileManager.Instance.GetContentType(sExt)

and so forth with the other methods.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesAlternative for deprecated functions in FileSystemUtils.csAlternative for deprecated functions in FileSystemUtils.cs


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