This is not server-based.
The user enters the image path in an input field for example “img/mountain.jpg”.
That image path is added like this
var imgPath = $("input").val();
$("div").css("background-image","url("+ imgPath +")";
Instead of it looking like this
It looks like this