Solved

The given path's format is not supported.

Posted on 2008-10-23
7
1,428 Views
Last Modified: 2012-05-05
Hi
I'm trying out DotNetZip. Seems good but can't get it to work, even the simplest demo;  see code below and errors....tries various combinations but didn't work.

Crashes at zip.Save(). See for folders I've tried to save at.

Thanks in advance for help on this
Dim ZipToCreate As String = "ex1.zip"
 

        'The given path's format is not supported. 

        'Dim DirectoryToZip As String = Server.MapPath("~/App_Data/TextFiles")

        'Dim DirectoryToZip As String = Server.MapPath("~/App_Data/TextFiles/")

        'Dim DirectoryToZip As String = "C:\"

        'Dim DirectoryToZip As String = "C:\\"

        'Dim DirectoryToZip As String = "C:\temp"

        'Dim DirectoryToZip As String = "C:\temp\"

        'Dim DirectoryToZip As String = "C:\\temp\\"
 

        'Could not find a part of the path 'c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ddddddddddd'. 

        'Dim DirectoryToZip As String = "ddddddddddd"
 

        'Could not find a part of the path 'C:\doesn't exist'. 

        'Dim DirectoryToZip As String = "C:\\doesn't exist\\"
 
 
 

        Using zip As ZipFile = New ZipFile(ZipToCreate)

            Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip)

            Dim filename As String

            For Each filename In filenames

                Console.WriteLine("Adding {0}...", filename)

                zip.AddFile(filename)

            Next

            zip.Save()

        End Using

Open in new window

0
Comment
Question by:rwallacej
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:David Robitaille
Comment Utility
did yu look at that
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23689805.html
it use the "fullname" instead of the name
0
 

Author Comment

by:rwallacej
Comment Utility
hi,
thanks for input

is this example for an older version ?

_zipFile.BeginUpdate()

says .BeginUpdate is not a method
0
 

Author Comment

by:rwallacej
Comment Utility
even a simple example like this isn't working :-(

 Using zip As ZipFile = New ZipFile("Backup.zip")
            zip.AddFile("C:\a folder\test.xml")
            zip.Save()
        End Using
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 18

Expert Comment

by:David Robitaille
Comment Utility
what error did you get? "The given path's format is not supported"?
at witch line exactly?
0
 

Author Comment

by:rwallacej
Comment Utility
yes this is the error, at line zip.Save()
0
 
LVL 18

Accepted Solution

by:
David Robitaille earned 500 total points
Comment Utility
ok how do you authenticate on the server.
You must make sure than the user that "run" the asp.net pages hevr proper rights in the folder you read and in the folder you write.
It could change depending of your config, but must of the times it<s IUSR_ComputerName
Also look ath this:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/3648346f-e4f5-474b-86c7-5a86e85fa1ff.mspx?mfr=true
0
 

Author Closing Comment

by:rwallacej
Comment Utility
thanks for help
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now