Image uploading to server and retreving back it

How to upload an image to server and how to get back it when we have image with huge data like 5MB .

I tried with base 64 format . am got able get exactly as a file is created in server side with 0bytes .