added remoteFilename parameter to upload