25-05-22 11:58 AM
Greetings,
Is there any way to rename files in ZIP ?
When we tried to extract from ZIP to Folder we get an error msg : Could not execute code stage because exception thrown by code stage: Illegal characters in path.
Later we found the file, the filename started with the "_" character. Or how can i extract files with special characters in file name?
One more thing, when we extract from ZIP manually there is no problem, but when with BP it's throwing error msg. Or when the BP successfully extract from ZIP , we get file names like "cn� spr�" ,the original name was "cná sprá".
------------------------------
Peter Vígh
------------------------------
Answered! Go to Answer.
30-05-22 01:22 AM
DotNetZip.dll
and the following 'Namespace Import': Ionic.Zip.
Also, ensure that the language chosen is 'Visual Basic'
as shown below:
Now, add a new action called as 'Rename Zip Entries' and add the below input and output parameters:Dim zipFile As ZipFile = ZipFile.Read(Zip_File_Path)
Dim entryExists As Boolean
For Each row As System.Data.DataRow In Entry_Names.Rows
entryExists = False
For i = 0 To zipFile.Count-1
If zipFile(i).FileName.Equals(CStr(row("Original Name"))) Then
zipFile(i).FileName = CStr(row("Modified Name"))
entryExists = True
Exit For
End If
Next
'Validate if the entry was not found in the zip file
If entryExists = False Then
If Message.Equals(String.Empty) Then
Message = "The current zip entry does not exists in the provided zip file path: " + Environment.NewLine() + Environment.NewLine() + CStr(row("Original Name"))
Else
Message = Message + Environment.NewLine() + CStr(row("Original Name"))
End If
End If
Next
zipFile.Comment = "This archive has been modified at the following date: " + Now.ToString()
zipFile.Save()
25-05-22 02:47 PM
25-05-22 03:01 PM
26-05-22 11:32 AM
Hello guys,
I tried the updated version of the Windows Compressed File utility, still have the same issue.
So the file name is : _fileName.docx - still getting the same error msg.
Is there any way to change the file name in ZIP?
Thank you.
30-05-22 01:22 AM
DotNetZip.dll
and the following 'Namespace Import': Ionic.Zip.
Also, ensure that the language chosen is 'Visual Basic'
as shown below:
Now, add a new action called as 'Rename Zip Entries' and add the below input and output parameters:Dim zipFile As ZipFile = ZipFile.Read(Zip_File_Path)
Dim entryExists As Boolean
For Each row As System.Data.DataRow In Entry_Names.Rows
entryExists = False
For i = 0 To zipFile.Count-1
If zipFile(i).FileName.Equals(CStr(row("Original Name"))) Then
zipFile(i).FileName = CStr(row("Modified Name"))
entryExists = True
Exit For
End If
Next
'Validate if the entry was not found in the zip file
If entryExists = False Then
If Message.Equals(String.Empty) Then
Message = "The current zip entry does not exists in the provided zip file path: " + Environment.NewLine() + Environment.NewLine() + CStr(row("Original Name"))
Else
Message = Message + Environment.NewLine() + CStr(row("Original Name"))
End If
End If
Next
zipFile.Comment = "This archive has been modified at the following date: " + Now.ToString()
zipFile.Save()