Basically, it can't be done. Not with HTML and JavaScript, anyway. It's
a security issue. What you're seeing is by design.

You'd have to use something other than <input type="file">.

-----Original Message-----
From: Casey C Cook 
Sent: Thursday, August 31, 2006 3:03 PM
To: CF-Talk
Subject: File attachment after user error

Once again Ive run into one of those "seems so easy, yet its so hard" 
situations. 

Basically, a user has the ability to attach up to 3 files on a form
<input type = file>. If the user throws an error, such as forgetting to
input a required field, the form will submit and go through
validation.cfm since they didnt pass the validation they will come back
to the submission screen. The problem is, I know the user has
input/attached a file, but browser security prevents me from populating
the input field with the previous entry. Does anyone know a good way
around this? I want to keep all the same logic in place, just be able to
somehow recognize the user has already made the effort to attach the
file and be able to submit that information after they correct their
error. So far we have discussed many other solutions which will work,
but require a coding effort greater than what should seem so easy -
populate the freaking value the user has entered previously. Seems like
I run across one of these scenario's once every six months and just
wonder why things seem so easy when talking about it, but next to
impossible in practice. Ive spent way too much time on this, any input
would be greately appreciated.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251671
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to