Fixed error caused by passing a local dir to put()

If the first parameter to 'put()' was a directory path, an unhandled exception would be thrown. This commit checks to see if the first parameter to 'put()' is a directory, and if it is, invokes the callback and an error.