You also can use php for the server-side which gets the file and stores it in HDD... It also can create the folder if needed...
PS: See my Signature for an example (without creating the folder)
Ok. So you have basically three choices : or to store the image's name in a file or database or to rename the chosen image as avatar.PNG. You'll have to decide