Jeff,
I've written an application that has to handle this same problem.  Here's what 
I did to solve it:


 1.  When the user submits the form, go ahead and accept the form upload on the 
server, but don't do the file upload or insert into the db yet.
 2.  After submission run a query of the db using criteria that will determine 
if more than one submission for this person has occurred.  In my case, my 
application allows only one upload from each person to a category of file 
uploads. (i.e, Bob Smith may only upload one file to the table for category A). 
 My query runs right after form submission and gets the record count where the 
criteria are true.  I use <cfif myduplicatequery.recordcount gt 0>.  This could 
be done with any element of the form, but I use the user's name and the 
category.  If I get a return record count of gt 0, the user has already 
submitted for this category.  However, there's a chance they want to replace 
their submission
 3.  If my cfif evaluates as true, I write the possible duplicate to a 
temporary directory and I display a form that:
    *   Tells the user they have already submitted something for this category.
    *   Displays the current submission information returned from 
myduplicatequery - (the original submission)
    *   Displays the new submission information.  I populate the new submission 
from the form variables submitted and use 
#cffile.serverFileName#.#serverFileExt# to display the new file they are trying 
to submit.
    *   Displays 2 buttons on the form. On Submits the other doesn't.
 4.  Based on the button value chosen I:
    *   Yes -  Move the file from the temporary directory to the usual 
destination directory. (Note: The file name can now be obtained from the form 
scope variable of the confirmation form as it was populated with 
#cffile.serverFileName#.#serverFileExt#.) I use cffile action=move and set 
nameconflict=overwrite as the user has chosen to replace their old file with a 
new one.  Then update the db with the new file name and any other variables 
that may have been changed from the original.  Then, display a success screen 
to the user.  I recommend using the usual error catching code to make sure the 
db write was successful.
    *   No - Delete the file from the temporary directory and then display a 
screen that says the replacement was aborted.

Hope this helps.

Brent Kitchens
Emory University





________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Howard
Sent: Thursday, March 20, 2008 11:45 AM
To: discussion@acfug.org
Subject: Re: [ACFUG Discuss] looking for opinions on duplicate form submissions

This is an internal application and js is enabled on all machines and everyone 
MUST use IE here.

The issue here is that the user must be the one to decide if it is a duplicate. 
 I'm merely notifying the user that there is a submission already that looks 
identical to what they submitted.  Then it's up to the user to decide if 
they're duplicating the work of someone else or their own.  So I have to query 
the db and display to the end user which form(s) already exist that contain the 
same data as theirs does and request that they review and then 'save' or 
'cancel'.

Is this something best suited for Ajax or is there an equally as efficient way 
to accomplish this without the use of Ajax?

-------------------------------------------------------------
Annual Sponsor - Figleaf Software<http://www.figleaf.com>

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink<http://www.fusionlink.com>
-------------------------------------------------------------

________________________________
This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).



-------------------------------------------------------------

Annual Sponsor FigLeaf Software - http://www.figleaf.com



To unsubscribe from this list, manage your profile @ 

http://www.acfug.org?fa=login.edituserform



For more info, see http://www.acfug.org/mailinglists

Archive @ http://www.mail-archive.com/discussion%40acfug.org/

List hosted by http://www.fusionlink.com

-------------------------------------------------------------


Reply via email to