No Sir you can't upload or change an image by its name
what I will recommend is a little bit complicated approach but it is cleaner and probably less coding
First, you want to save the image on the server side as ByteArray,So in your database it should be saved as BLOB Type, And you can keep the same code for the upload Image Service API
Let us move to the client side
save the image as a String on the client side and then when you receive the image from the server side it should save the ByteArray(BLOB in the database) in a string variable(client side) after that convert the string to byteArray in your android studio then you can get Bitmap object out of the byteArray, Finally use the bitmap with Library called Glide which can load bitmap to your imageView/recyclerView
this is the code for the client side when you receive the image from the back end (server-side) :
val imageFromServer :String = *logic getting image byteArray from server*
val bytes: ByteArray = Base64.decode(imageFromServer , Base64.DEFAULT)
val imageInBitmap: Bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
//Glide Library
Glide.with(context)
.load(imageInBitmap)
.centerCrop()
.placeholder(*use your holder picture or don't*)
.into(*your imageview i recommend to use binding view if you are not using it *)
and this is the dependency for Glide Library :
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
From there you can change and delete the image as you desire
and if you want to share it with other screens(Activities ) use SharedPrefrence instead of Intent.putExtra, Because Intent space's limit is 1MB and it won't handle the image's Bytes also will throw Exception
and yes this answer is for dealing with MultipartFile
please tell me if you still didn't understand or have a question about this approach
and would be amazing if you provide me with some information about the back-end framework you are using, I answered by assuming that you are using Spring Boot but I can be more specific