here is my code How to use repeat function in kotlin :
var it = 0
val uploadImage=AndroidNetworking.upload(Constant.BASE_URL + "app.php?api=editprofile")
repeat(imagesFiles.size){
uploadImage.addMultipartFile("image", imageFileOne)
uploadImage.addMultipartFile("image${it+1}", imagesFiles[it])
}
it++