How to get the url of a file named 'myfile' from an owner guid ?

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. 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking