Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@Demerit the path property is read only, i don't think it's possible to do so if you check the database table civicrm_file you find no path column, instead you find the uri which is just the file name, then civicrm will do the rest and calculate the path depending only on the file name, at least that's what i understood.