Added upload media function
Merge remote-tracking branch 'upstream/master'