How to download and save a file in a dynamic folder created in runtime

Hi,

I am creating a folders dynamically upon clicking on search and have to download and save file from the webpage to the folder created dynamically , how to do that?
I am using IE and i have to utilize save as when downloading.

@indrajit.shah

After clicking download, it will show in save as right. Just click on that and it will show one pop up page and then use Type Into activity and pass the folder name you want to save the file.

5 Likes

Hi @indrajit.shah!

do you know folder name that you want to create?

if you do, you can have some string BASE_URL to your root folder and before saving file use path exist for BASE_URL+folderName. If path exist, just save that file and if it’s not exist use “create directory” activity (or you can create directory with powershell it’s the same) and then you can save file.

I think that is easiest way and you are checking if paths so there is small room for error :smiley:

I am getting this error

I have excel file from where folder’s name are taken, for every trans. the folder name is different, and in every tran. file will be saved to respected folder.

Hi @indrajit.shah,

if you want to convert into int, you must write cint(someString) or if you have int and you want to convert it to string you must write cstr(someInt)

hope it helps!

@indrajit.shah

It’s looks like you indicated wrong window in Type Into Activity. Use Click Activity to click Save as option and then one pop up will come. Then use Type Into Activity and pass the file name along with the folder path.

Hi,

Thank you for your reply,

I am getting this error now

Compiler error(s) encountered processing expression “string Config(“OUtputFolder”).ToString+”"+TransactionItem(“FOLDER NAME”).ToString+“\eform”+“\Additional Documents”".
‘.’ expected.

@indrajit.shah

Could you please show me screenshot of this expression.

Hi @lakshman,

I m so sorry, it was my mistake i did it wrong that time, but I am getting this error now :-

Compiler error(s) encountered processing expression “String Config(“OUtputFolder”).ToString+”"+TransactionItem(“FOLDER NAME”).ToString+“\I-9eForm”".
‘.’ expected.

image

I am trying to save the file to a particular location but not want to change the file name too, what to do??

the folders and sub-folders are created dynamically in a different workflow and in this workflow i have to download the file to the sub-folder created.

Config(“OUtputFolder”).ToString+“"+TransactionItem(“FOLDER NAME”).ToString+”\I-9eForm"

@indrajit.shah

Why you typed String at the starting in Type Into Activity

getting this error on removing string

Compiler error(s) encountered processing expression “Config(“OUtputFolder”).ToString+”"+TransactionItem(“FOLDER NAME”).ToString+“\I-9eForm”".
Option Strict On disallows implicit conversions from ‘String’ to ‘Integer’.

Did u resolve thz

Yes I did.

what is it you are look for?