Why a file form doesn't work in a "showModalDialog" javascript
Hi all, I included the following code in a web page to be able to upload an image into the zodb: <form method="POST" name="frmImageUpload" enctype="multipart/form-data" action="uploadImage"> Upload Image: <BR> <input type="file" name="file" size="40"/> <input type="submit" name="upload" value="upload"/> </form> The processor script "ploadImage.py begins with : ## Script (Python) "uploadImage" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath #parameters: file='' ##title=Upload an image file = context.REQUEST.get('file', '') filename = file.filename . The form works well if I use it in a web page, but when I call this webpage using a showModalDialog javascript function (I need to do this to retrieve values from the webpage when the window is closed.), the form doesn't work anymore. Actually, the uploadImage script thinks that "file" is a String and not a file anymore --> it can't retrieve the filename attribute and the rest of the script will crash. And this is just if my webpage is called from a showModalDialog javascript function. Is there any "context" related tricks here ??? Any clue on this? -- Jean
participants (1)
-
Jean Baltus