[
  {
    "Id": "485197",
    "ThreadId": "224950",
    "Html": "<p>Thanks for a great library first off :-)</p>\r\n<p>I am having an issue where any attempts to add files with spaces in the name is failing miserably.&nbsp; Folders are working fine, regardless but files I can't seem to figure out how to rectify the problem. I am by all accounts a novice to VB 2010 so this may be a self induced problem from poor coding practise :-)&nbsp;&nbsp; but i don't know.</p>\r\n<p>Here is an example:</p>\r\n<pre>Private Sub RunSingleArchiveSave(ByVal Colname As ListBox.SelectedObjectCollection, ByVal Zipfolder As String, ByVal ArchiveName As String)\r\n        ResetState(&quot;OFF&quot;)\r\n        PictureBox2.Visible = True\r\n        Try\r\n             Using zip1 As ZipFile = New ZipFile()\r\n                With zip1\r\n                    If ComboBox3.Text = &quot;06 = Default&quot; Then .CompressionLevel = CompressionLevel.Default\r\n                    If ComboBox3.Text = &quot;09 = Best Compression&quot; Then .CompressionLevel = CompressionLevel.BestCompression\r\n                    If ComboBox3.Text = &quot;01 = Fastest&quot; Then .CompressionLevel = CompressionLevel.BestSpeed\r\n                    If ComboBox3.Text = &quot;02&quot; Then .CompressionLevel = CompressionLevel.Level2\r\n                    If ComboBox3.Text = &quot;03&quot; Then .CompressionLevel = CompressionLevel.Level3\r\n                    If ComboBox3.Text = &quot;04&quot; Then .CompressionLevel = CompressionLevel.Level4\r\n                    If ComboBox3.Text = &quot;05&quot; Then .CompressionLevel = CompressionLevel.Level5\r\n                    If ComboBox3.Text = &quot;07&quot; Then .CompressionLevel = CompressionLevel.Level7\r\n                    If ComboBox3.Text = &quot;08&quot; Then .CompressionLevel = CompressionLevel.Level8\r\n                    .Comment = &quot;The Canadian Archiver (https://www.chriskelly.ca/)  &quot; &amp; vbCrLf &amp; TextBox2.Text\r\n                    .Password = MaskedTextBox1.Text\r\n                    .TempFileFolder = Zipfolder\r\n\r\n\r\n\r\n                    Me._entriesToZip = zip1.EntryFileNames.Count\r\n                    Me.SetProgressBars()\r\n                    AddHandler zip1.SaveProgress, New EventHandler(Of SaveProgressEventArgs)(AddressOf Me.zip1_SaveProgress2)\r\n                End With\r\n\r\n                Dim SaveToDirectoryPath As String = Zipfolder\r\n                \r\n\r\n                For Each item In Colname\r\n                    Dim SpaceLessName As String = Replace(item.ToString, &quot; &quot;, &quot;_&quot;)\r\n                    zip1.AddSelectedFiles(item.tostring, Zipfolder, &quot;&quot;, True)\r\n\r\n                Next\r\n                '  zip1.AddItem(Zipfolder &amp; &quot;\\&quot; &amp; ZIPName)\r\n                Dim endresult As String = ((SaveToDirectoryPath.ToString &amp; &quot;\\&quot; &amp; (ArchiveName)))\r\n                zip1.Save(endresult)\r\n                ' End If\r\n            End Using</pre>\r\n<p>&nbsp;</p>\r\n<p>so if i replace the space in the file with let's say &quot;_&quot; i then need to do this to the file also (obviously) which I can do but would rather not have the act of archiving result in file modification. I have tried adding single and double quotes to encapsulate but then I get path errors.&nbsp; to note i have 2 textboxes, one with a single quote (SQ) and one with a double quote(Q) i use these to add the quotes so perhaps that is my issue but it seems to work with everything else (ie:&nbsp;dim whatever as string = (&nbsp;q.text &amp; &quot;whatever&quot; &amp; q.text) )</p>\r\n<p>&nbsp;</p>\r\n<p>so i am hoping someone could tell me or show me whether i am indeed causing my own grief or if this is a problem of some other sort.</p>\r\n<p>&nbsp;</p>\r\n<p>I also thought about modifying the workflow in the code so that when a file is found with spaces in the name a directory is created by that name in the file system and the file added in there and then zipped, as adding a directory to a zip with spaces in the name works just fine</p>\r\n<p>&nbsp;</p>\r\n<p>anyways thanks for any insight that can be offered and again, thanks for this library it really is nice to not have to go knocking on chilikat's door for a zip control :-)</p>",
    "PostedDate": "2010-08-26T07:02:14.29-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "485199",
    "ThreadId": "224950",
    "Html": "<p>also this is not used by the way</p>\r\n<p>For Each item In Colname<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim SpaceLessName As String = Replace(item.ToString, &quot; &quot;, &quot;_&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip1.AddSelectedFiles(item.tostring, Zipfolder, &quot;&quot;, True)</p>\r\n<p>it is like so:</p>\r\n<p>For Each item In Colname<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip1.AddSelectedFiles(item.tostring, Zipfolder, &quot;&quot;, True)</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>sorry that was some failed attempts from late last night :-)</p>",
    "PostedDate": "2010-08-26T07:05:35.227-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]