Get PDF file to put into zip

I am trying to zip two files into a .zip. I ran a log to and i see that one file it finds, the other file it does not. What is the easiest way for me to find a .pdf file in a directory that only has 1 .txt, 1 .xlsx and 1 .pdf? I tried to use Directory.GetFiles(“C:\Temp\KenoKozie”,“.pdf") but i get an error about the string. Not sure what else i can do. The error says "Compiler error(s) encountered processing expression “Directory.GetFiles(“C:\Temp\KenoKozie”,”.pdf”)". value of Type ‘1-dimensional array of String’ cannot be convereted to ‘String’. "

Main.xaml (36.8 KB)

Hey @atarantino !! Use this expression

Directory.GetFiles(“C:\Temp\KenoKozie”,"*.pdf")

With “*” before “.pdf”!
Another note is that the return is an array of String, not a String. So you need to store it in an Array.
image

Hope it help!

Thanks. It still isn’t finding the PDF to use in the zip activity. the log comes up System.String

Sytem.string

Debug your code and see what activity is throwing this error, then send here!

Are you using the GUI winzip or the commandline:
wzzip.exe -a -p -r C:\DestinationPath\DataFiles_20130903.zip C:\SourcePath*.dat C:\SourcePath*.bat.

I have used the wzzip in the past and it works great.

I figure it out. The initial .pdf file comes from off an email. During the save attachment activity, i created an output i called PDFOutput which is a System.Collections.Generic.IEnumberable<system.string> variable type. I then used an assign activity and created a string variable called PDFFile where in the argument i joined the strings using string.join(“,”,PDFOutput). This string value was able to be passed in the compress/zip activity and works fine now.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.