Added resource upload function (needs testing/debugging)