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

FORM.screenshot is Undefined

Guest
Jul 24, 2009 Jul 24, 2009

Hi. I am trying to upload a file from a form. In my CFFORM, i have the following input:

<cfinput type="file" name="screenshot" width="250" value="" />

The page I submit to has this line at the top:

<cfif FORM.screenshot NEQ "">

       <!--- first actually upload the file --->

       <cffile action="upload"

                 filefield="screenshot"

                 destination="D:\temp\"

                 nameconflict="makeunique">

        <!--- now create a temporary holder for the attachment later on --->

        <cfset screenshot_local_file = "D:\temp\#file.serverfile#">

</cfif>

However, when I upload the page, I get FORM.screenshot is undefined. All other form fields work fine.

Thanks for the help. 🙂

767
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
Contributor ,
Jul 24, 2009 Jul 24, 2009

hi

try this

<cfif isdefined('form.screenshot') AND form.screenshot  NEQ "">

....

......

</cfif>

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
Guest
Jul 24, 2009 Jul 24, 2009

Thanks, I tried, but all I get is an email without the file I selected in the form... as if FORM.screenshot is still undefined.

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
Guest
Jul 24, 2009 Jul 24, 2009

Actually, I fixed it. I did some more Googling, and added

enctype="multipart/form-data"

to my cfform tag and it worked. Thanks anyways for the help!

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
Guest
Jul 24, 2009 Jul 24, 2009
LATEST

Actually, I fixed it. I did some more Googling, and added

enctype="multipart/form-data"

to my cfform tag and it worked. Thanks anyways for the help!

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