Upload file to external file storage

Is there a straightforward way to upload an image file to a chosen external file location from code? The location I have in mind is already set up as a sub-domain of my site.