How to get the specify images file name to variable?

jackeyroe1

Client
Регистрация
17.10.2013
Сообщения
218
Благодарностей
50
Баллы
28
Hi friends

I have a question, for example, I have 3 jpg images in my folder "images", the 3 images file are: aImage.jpg bImage.jpg cImage.jpg

Now I want upload these 3 images one by one to sample site, then get the specify image name as variable, then delete the image after it uploaded.

The process may like the following:

get aImage.jpg from "images" folder to upload to sample site -> get the image name "aImage" (without '.jpg') as project variable "imageName" -> delete aImage.jpg

Is there any actions or C # could do this?

Any kind friend could tell me? :-)




Thanks much !!!
 

js3000

Новичок
Регистрация
19.07.2020
Сообщения
17
Благодарностей
5
Баллы
3
Hi, first create a list. You can use "Get file list" action (Action-->Data-->Directories) and your 3 jpg file paths will be in the choosen list. Then you can use list porccesing "get line" go get one of the file pathes and use the variable to upload the images. If you activate "delete line after taking" in the list proccsing you can loop these actions until the list is empty.
 
  • Спасибо
Реакции: lokiys и jackeyroe1

jackeyroe1

Client
Регистрация
17.10.2013
Сообщения
218
Благодарностей
50
Баллы
28
Hi, first create a list. You can use "Get file list" action (Action-->Data-->Directories) and your 3 jpg file paths will be in the choosen list. Then you can use list porccesing "get line" go get one of the file pathes and use the variable to upload the images. If you activate "delete line after taking" in the list proccsing you can loop these actions until the list is empty.
Very helpful! Thanks much! :-)
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
@js3000 logic is totally fine and there is also a wiki link about directories and files. You can also see how to delete files after use.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)