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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0FileSystemUtils.UnzipFile ErrorFileSystemUtils.UnzipFile Error
Previous
 
Next
New Post
8/20/2007 4:45 PM
 
I have a a private sub as follow:

1 Private Sub UnzipAndDeleteFiles()
2 Dim targetFolder As String = Server.MapPath(RadUpload1.TargetFolder)
3 Dim targetDir As New DirectoryInfo(targetFolder)
4 Dim targetExt As String
5
6 Dim strSourceFile As String = ""
7 Dim strDestFile As String = ""
8 Dim StrMessage As String = ""
9
10 Dim file As System.IO.FileInfo
11 For Each file In targetDir.GetFiles()
12 targetExt = Path.GetExtension(file.Name)
13 strSourceFile = targetFolder & "\" & file.Name
14 strDestFile = targetFolder & "\CMS\"
15 If targetExt.ToLower = ".zip" Then
16 StrMessage = StrMessage + FileSystemUtils.UnzipFile(strSourceFile, strDestFile, PortalSettings)
17 End If
18 If (file.Attributes And FileAttributes.ReadOnly) = 0 Then
19 file.Delete()
20 End If
21 Next file
22 End Sub


I keep getting an error: Object reference not set to an instance of an object. on Line # 16. I tried to debug and I noticed the Portalsettings disappears from the list of object in my debugging mode. I tried to store the portalsettings in a private object using "new" and still getting an error on the same line. Both parameters strSourceFile & strDestFile have values in them while debuging, and there is already a file that I'm trying to unzip in the folder. I used the same line as in the filemanager module. What I'm doing wrong?
 
New Post
1/27/2008 5:21 PM
 

Hi there

Also get the same problem, did you or anyone else out there find a solution to this ?

Thanks

Andy

 
New Post
3/28/2008 6:31 AM
 

I've got the same problem!

Anyone a solution?

 
New Post
9/16/2010 2:57 AM
 
A late reply, but I just worked this out and thought I'd put the solution down for anyone else that runs into this.

The UnzipFile function requires that the file you are unzipping is in your Portal's home directory folder. You can't pass the full path the of the file you are unzipping, only the filename, then the function looks for the file in the Portal folder, usually something like... "C:\inetpub\wwwroot\MyDnnSite\Portals\0"
 
New Post
9/16/2010 10:25 PM
 
Christian Bishop wrote:
A late reply, but I just worked this out and thought I'd put the solution down for anyone else that runs into this.

The UnzipFile function requires that the file you are unzipping is in your Portal's home directory folder. You can't pass the full path the of the file you are unzipping, only the filename, then the function looks for the file in the Portal folder, usually something like... "C:\inetpub\wwwroot\MyDnnSite\Portals\0"

My mistake, this in incorrect and has not solved the issue.

I ended up using the code on this page to un-zip file file.

http://wiki.sharpdevelop.net/SharpZipLib-Zip-Samples.ashx

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0FileSystemUtils.UnzipFile ErrorFileSystemUtils.UnzipFile Error


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