In your tinymce.init, you could call a function that executes on change, and then run a regex to replace the filepath with that function url? like so:
tinymce.init({
setup : function(ed) {
ed.on('change', function(e) {
// call your regex function here
// or in php maybe an ajax call to a function?
});
}
});