Get file url from owner

Hi everyone,

I'm looking for a function that would give me the url of a file (image) from the owner of the image. Just like it is possible to get the iconUrl of a user... How would you write such a function ?



function get_file_url(file_name, owner_guid) {

// file_name == 'background' for instance

// returns something like the src of a user avatar...

return the_url ;

// the_url can then be used in the html : "style='background:url(the_url)'"

}



I'm lost, don't know how to do it properly.