Faking a form post is possible, but it's much simpler to use the Files API
Edit:
To use the File API with urlfetch you would write something like this:
from __future__ import with_statement
from google.appengine.api import files
from google.appengine.api import urlfetch
url = "http://www.facebook.com/somephoto.png"
result = urlfetch.fetch(url)
if result.status_code not 200:
return "some error"
# Create the file
file_name = files.blobstore.create(mime_type='application/octet-stream')
# Open the file and write to it
with files.open(file_name, 'a') as f:
f.write(result.content)
# Finalize the file. Do this before attempting to read it.
files.finalize(file_name)
# Get the file's blob key
blob_key = files.blobstore.get_blob_key(file_name)
I haven't tested this - so if this doesn't work, let me know.
Also, I believe you can leave the mime_type as 'application/octet-stream' and App Engine will try and guess the proper type. If that doesn't work try changing it to 'image/png'. Or for a pdf the mime type would be 'application/pdf'