Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Showing initial value in cfinput type="file"

New Here ,
Jun 12, 2010 Jun 12, 2010

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">

TOPICS
Getting started
557
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 12, 2010 Jun 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 12, 2010 Jun 12, 2010
LATEST

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources