Saving Bitmap Info

Does anyone have any ideas how I might go about saving a custom bitmapdata object as a jpeg file to the server or something similar?