 <p>Logic depends as per your need and current DB structure. some possible solution could be <br/> -If your path is fix, just store image name. and while creating full path join +<br/> -If path is no fixed and storing path in DB, you can create one column more column and store unique id(any integer or alpanumeric as per logic but unique value) and use that unique value to replace path</p>