How to convert FileInfo type to IResource type

Hello everyone!

I get FileInfo type data from “Wait for download” activity.

I want to add this to gmail attachment. But I need to convert this to IResource type. How can I do it?

Thanks!

Hi @KezayAlperen
Can you try below expression:
LocalResource.FromPath(txtFile)
Hope this will work

Happy Automation!

Hi @Akash_Javalekar1 ,

I got this error. I wonder if I did something wrong? :))

What is txtFile varaible type?
try this one
LocalResource.FromPath(txtFile.ToString)

1 Like

FileInfo

if its working please mark as solution!

Happy Automation

I tested it and it works!

Thank you very much @Akash_Javalekar1 :))

Happy Automation

1 Like

I am glad to help you !

Happy Automation

Use this when you have a varying number of attachments; by building a list by iterating through a folder etc

image

image

image

2 Likes

It will be very useful for me

thank you so much @sudster :))

Please note, for a FileInfo var, you can also use txtFile.FullName

1 Like

thank you @sudster

I will note it :))

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