timdw
Posts: 25
|
| Posted: 10/09/2005, 1:01 PM |
|
I seem to remember seeing something somewhere which detailed the sequence of events as a Codecharge generated page loaded. Does anyone know where this is?
More specifically, I have a record form with a file upload control. Does BeforeProcessFile happen before or after validation? I'm trying to avoid the situation where a file is uploaded, record validation fails on another field, the changes are abandoned by the user leaving the uploaded file "orphaned" as the record is not updated with the newly uploaded file's location.
Thanks,
Tim
|
 |
 |
DonB
|
| Posted: 10/10/2005, 5:31 PM |
|
The BeforeProcessFile event fires as part of the Upload method, which is
done before the insert/update (in which the Validate event occurs).
So, the answer is BeforeProcessFile happens long before Validate.
--
DonB
http://www.gotodon.com/ccbth
"timdw" <timdw@forum.codecharge> wrote in message
news:24349772129911@news.codecharge.com...
> I seem to remember seeing something somewhere which detailed the sequence
of
> events as a Codecharge generated page loaded. Does anyone know where this
is?
>
> More specifically, I have a record form with a file upload control. Does
> BeforeProcessFile happen before or after validation? I'm trying to avoid
the
> situation where a file is uploaded, record validation fails on another
field,
> the changes are abandoned by the user leaving the uploaded file "orphaned"
as
> the record is not updated with the newly uploaded file's location.
>
> Thanks,
>
> Tim
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
timdw
Posts: 25
|
| Posted: 10/11/2005, 7:28 PM |
|
I thought I'd replied to this - must have dreamed it .... 
Thanks for the info. I've moved the upload control into another record so I could handle it completely seperately.
Cheers,
Tim
|
 |
 |
timdw
Posts: 25
|
| Posted: 10/12/2005, 1:34 PM |
|
Hmm, much head scratching later it turns out that the BeforeProcessFile and AfterProcessFile happen in the clsFileUpload method Move(). This is (as far as I can tell) only invoked in the record control's InsertRow() and UpdateRow() methods, which means two things:
- uploaded files are moved from temp only after successful validation and record insertion/update, and
- the upload control must be bound to a DB column otherwise it won't work. This is where I'm going wrong at the moment 
IMO the first is sensible behaviour, as only temp can get littered with files (so what - schedule a cleanup) but the second is a little aggravating mainly because it's not what I expected
|
 |
 |
|