UPDATE -
I've been trying to figure out the user_avatar_upload function in phpBB's usercp_avatar include.
I "think" what it does is uses fread on the posted url, stores the data on a variable, then fwrite the variable's data in a file on the webserver.