Skip to main content
Known Participant
June 12, 2010
Question

Showing initial value in cfinput type="file"

  • June 12, 2010
  • 1 reply
  • 589 views

I've added a cfinput tag to a form that is intended to choose an image file to upload to a server. If I set the input to be of type="text", the initial value shows up as I expect. If I set the input back to type="file", I can't get it to show the initial value. Is there a trick I should know?

I've tried using the full path:

<cfinput name="FeaturedImage"
                            value="C:\ColdFusion9\wwwroot\cpac\images\events\#FeaturedImage#"
                            type="file"                          
                            size="60">

as well as the relative path:

<cfinput name="FeaturedImage"
                            value="#FeaturedImage#"
                            type="file"                          
                            size="60">

This topic has been closed for replies.

1 reply

Inspiring
June 12, 2010

This is not a CF thing, it's an HTML thing.  Most browsers do not support givin an initial value to <input type="file" /> control.  This is because of the perceived security risk in populating a control that accesses the local client file system.

--

Adam

earacheflAuthor
Known Participant
June 13, 2010

Ah, I didn't know that. It seems as though Dreamweaver should be smart enough to at least let you know that.

Tools, helpful sometimes, sometimes not.

Thanks!