|
Posted by Pugi! on 01/02/07 15:58
I am making a website with a fixed page. Different actions/events
replace content on specific places on the webpage. For user input I
create a form in a new layer (div) on top of other content. When submit
is pressed I check (xmlhttprequest) input on server, when OK data is
inserted in database and an OK signal is returned (response.xml) to the
client and the form (layer) disappears. When needed part of contents on
screen is refreshed/reloaded. When not OK an error message
(response.xml) is returned from server and used to displayed the
error(s) on the form near the input-field()s that caused it/them.
So far so good. Works fine.
But now I have to do the same including a file upload.
I create a form in a new layer on top of other content. A file is
selected and user has to input a lot of information (metadata, like
project, contents, summary, authors, kind of data in file, ...). When
submit is pressed I have to check if input is correct. If input is
correct and file is uploaded I have to return an OK -signal so form can
be closed. If not OK I have to show the errors near the input-fields
that are not valid so giving user the oppurtunity to correct mistakes
instead of starting all over again. But how do I do this ?
Press submit, send input (except) file to server, check if ok, start
transaction, insert in database, upload file (how), if everything OK,
commit otherwise rollback. Or submit all data (including file) to
server, check if ok, start transaction, insert in database, check
uploaded file, if everything OK, commit otherwise rollback.
It leaves me puzzled how to upload a file with AJAX and submitting
other data at the same time. The examples of progressbars for file
uploads don't really answer my questions.
Can anyone help me, point me in the right direction or link to an
example ?
thanx,
Pugi!
[Back to original message]
|