Continuing with the project from last time and before (here, here, and here).
I got two more things working: a dropdown menu and sending a file.
It would be nice if the user could only send the file types we want to accept, but that's not the way it works, at least you can't disable the unwanted types in the file dialog the way you can from Cocoa. I tried to use an
accept
attribute, but then I found it isn't supported by any browser! (Lost track of where I saw this, it's not mentioned in the spec). Two possibilities: javascript to check the file extension, or coding in the script. I wasn't able to find MIME type info, see the printout. Probably the best would be to use Python-magic or something like it.
I had some errors that seemed to be related to file permissions, but at the moment it is working with:
I'm having trouble with output, so here is a screenshot of the first few lines:
form.html
:script.py