automationrpauipathuipath-studiouipath-activity

How to read all media files and upload one by one?


In uipath process

See small video : https://www.loom.com/share/02b00cbdb0854fe1b4e66766814ce90c

I made process but it needs to tell every run file name from the excel sheet

any method replace and no need excel data bot will automatically recognize media files from given path all media into variable and one by one upload


Solution

  • If I understand the question correctly, what you want is to look at all the files in a given folder, and if they are media files, carry out an upload action. You haven't been any more specific about how this upload is occurring so I'm going to be pretty generic in the answer - if you need further help, you'll have to update the question with more information.

    Firstly, you can add a For Each activity and provide the Directory.GetFiles("yourpathtofolderhere") as the source of the items.

    This will allow you to iterate over each file in the folder (it is referenced as 'item' by default).

    You can then, for item, get the file extension using the Path.GetExtension method. You can then use a simple If condition to determine if the extension matches whatever you are considering to be "media files" and where it does, step onto your upload action. Where it doesn't, either do nothing or (my preference) log the file name and that it was seen but isn't a match.

    If you need any further explanation of the above let me know.