1

I have a file input element on my HTML page like so :

input type="file"

which receives the path to an image file chosen by the user.

I need to pass this image to a python script for the remainder of the processing. How do I go about doing this? I'm familiar with CGI and its working. I am unclear on how I would send the image per se.

Thanks for your help!

Xstatic
  • 1,411
  • 1
  • 11
  • 14

1 Answers1

2

You have to set the "enctype" field:

<form enctype="multipart/form-data" action="save_file.py" method="post">

in your HTML form. it is unclear whether you did or not, since you only provided partial information. Please have a look at http://webpython.codepoint.net/cgi_file_upload for a detailed explanation on how to proceed.

Christophe
  • 1,942
  • 3
  • 21
  • 29