Copy all Photos with Copy Activity

Hi Team,

i need to copy all the photos in specific folder to another one however when i indicate i can selecet one photo only.

so is there anyone knows how to copy all the photos in one time?

Hi Omar,

Use for each file in a folder activity: Loop on all photos through it, then use copy file to move it one by one inside the loop.

You could also copy the entire folder and paste it at once(zip it if you have to)

Hi @omar_ismail

Try this-

  1. Use the “Directory.GetFiles” method: Add an Assign activity and use the following expression to get the list of all image files in the source folder:
filesArray = Directory.GetFiles("sourceFolderPath", "*.jpg")

Replace “sourceFolderPath” with the actual path of the folder containing the photos.
2. For Each Loop: Add a For Each activity to loop through each file in the “filesArray” obtained in the previous step.
3. Copy File: Inside the For Each loop, use the “Copy File” activity to copy each file to the destination folder.

  • Set the “From” property to the current file path.
  • Set the “To” property to the destination folder path combined with the file name.Example: "destinationFolderPath\" + Path.GetFileName(file)

Thanks!!

Can you check your variable filesArray it should be of String Array type.

Thanks.