RE: [Zope] RE: Re: Tracking upload of files to Zope
[ Gitte Wange]
Okay - I can see that just dislaying an 'upload in progress' would be the best way to do this. So I follow this path :-)
Which leaves me with one last question: PageA contains the <form> that has a <input type="file"> element. PageB contains a text saying 'Upload in progress ...' When that form is submitted, the page won't return until the entire file is uploaded (and then the wait text won't get displayed). So what I need to do is to make some sort of hidden frame that submits the form ?
How would you do this ? (sorry - it's not obvious for me)
I have done it using (ordinary) frames, and with poup windows. It always takes a bit of javascript. You want to display the message before starting the upload. You do not need a hidden frame to submit the form. Say you have decided how you want to display the message. You can do something like this - <head> function displayMessage() {//show message ...} function upload() { displayMessage() document.yourform.submit() } </head> <body> ... <form name='yourform' action='....' encoding='...'> .... <input type='button' value='Upload File' onClick='upload()'> </form> ... </body> This leaves you with two things to work out - 1) How to display the message 2) How to cancel the message display. If you display the message within the page, it will automatically go away when the file finishes uploading. That takes care of 2) so that would be the easiest thing to do. You could - 1) Display the message in an iframe. 2) Display the message in a text input box. 3) Display the message in an existing element in the HTML page. 4) Display the message in a popup window and close it using the onUnload event when the upload finally finishes. If it were me, I would create a div element for the message and hide it using the CSS instruction display:none. I would use the DOM method getElementById() to get a reference to it and change the style to display:block when I wanted to show it. However, this will not work with older browsers (like NS4) or lynx. I would not care about that, but you may very well care. With lynx, you really cannot do much, but with NS4 yuu would just have to use a slightly different approach to locate the element you are interested in. My preferred approach should work in IE5+, Mozilla, NS6+, and (I think) Opera 7+. Obviously the browser needs to support the DOM, otherwise you have to go to browser-specific methods. That leads to the iframe. For browsers that support the iframe, you can just write into an element in the iframe using document.write(), or have it load a static page from the server. Let us know if you need more information. Cheers, Tom P
participants (1)
-
Passin, Tom