Filesystem is not persistent on the cloud, so it is NOT a good practice to upload files to the file system in the same way you on your hard disk.
Application being redeployed/scale-out will start on a distinct node, so you shouldn't store files there. We recommend to store using amazon S3 (or comparable file store) and use local ("ephemeral") filesystem as a temporary cache.
You can use System.getProperty("java.io.tempDir") to get the configured local temp.
CloudBees also provides two different examples which could help you to upload files to Amazon S3 -you can also use Dropbox, Google Drive,..-.
More info here.