title: Upload a File with Python
body: <p>I have an HTML form and I am using Python to generate a log file based on the input. I'd like to also be able to allow the user to upload an image if they choose. I can figure out how to manipulate it with Python once it's there, but I'm not sure how to get the image uploaded. This has most certainly been done before, but I'm having a hard time finding any examples. Can any of you point me in the right direction?</p>
  
  <p>Basically, I'm using <code>cgi.FieldStorage</code> and <code>csv.writer</code> to make the log. I want to get an image from the user's computer and then save it to a directory on my server. I will then rename it and append the title to the CSV file.</p>
  
  <p>I know there are a lot of options for this. I just don't know what they are. If anyone could direct me toward some resources I would be very appreciative.</p>