I'm a newbie to python and have the following problem:
What's the best way storing files from web forms straight into a database?
I have a web form where users attach a file. The information and the file have to be stored in mysql. The form and the script work fine when I run it from the web server. As soon as I submit the form from another pc an error occurs:
The error seems logical, the path from the form does not exist on the web server.
I'm using the following code:
Does anyone have a tip? (Guess an option would be to save the file to the web server's hd first and then insert it into the db.)
form = cgi.FieldStorage()
file = open(form.getvalue('filename'), 'rb').read()
Thx in advance