@voylinux As mentioned, you can upload to whichever CDN you want, or you can do an AJAX request to the ApiMediaUpload action, generally /api/statusnet/media/upload (I don't think that URL is discoverable via host-meta currently, but I think I will make it so! Then any site can have any media upload endpoint they want)
To do it with curl, try setting the three variables I use and run:
curl -s -u ${socialusername} -F"media=@${filename}" "${instance}/api/statusnet/media/upload"
A successful response will contain information about the uploaded file. To see how !qvitter uses this, check out this part of the code: https://github.com/hannesmannerheim/qvitter/blob/master/js/qvitter.js#L3511-L3572