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

cffile not accepting image

Contributor ,
Jul 26, 2006 Jul 26, 2006
This is the value of the file coming from form.thumbnailpic
Image to load "mart.jpg"
<!--- Directory --->
<cfset postfile2 ="F:\site\sponsors\1\Images\ ">
The image is not being Uploaded to the Directory. See code below

<cftry>
<cftry>
<cffile action="UPLOAD"
filefield="thumbnailpic"
destination="#postfile2#"
accept="image/*"
nameconflict="Overwrite">
<!--- Catch error.--->
<cfcatch type="Any">
<cfset erroroccured = #erroroccured# &","& "Thumbnailpic not saved">
</cfcatch>
</cftry>"
TOPICS
Getting started
632
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

correct answers 1 Correct answer

Contributor , Jul 26, 2006 Jul 26, 2006
Got it working
I forgot to set the form to enctype="multipart/form-data” … see below
<form name="b" action="xxx.cfm" method="post" enctype="multipart/form-data”>
Translate
LEGEND ,
Jul 26, 2006 Jul 26, 2006
Are any errors being thrown or does the image file just not appear?

If there are error messages, have you checked the <input type="file"...>
tag? Filters can be assigned in the tag as to what type of files can or
can not be uploaded there as well.


umuayo wrote:
> This is the value of the file coming from form.thumbnailpic
> Image to load "mart.jpg"
> <!--- Directory --->
> <cfset postfile2 ="F:\site\sponsors\1\Images\ ">
> The image is not being Uploaded to the Directory. See code below
>
> <cftry>
> <cftry>
> <cffile action="UPLOAD"
> filefield="thumbnailpic"
> destination="#postfile2#"
> accept="image/*"
> nameconflict="Overwrite">
> <!--- Catch error.--->
> <cfcatch type="Any">
> <cfset erroroccured = #erroroccured# &","& "Thumbnailpic not saved">
> </cfcatch>
> </cftry>"
>
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
Explorer ,
Jul 26, 2006 Jul 26, 2006
try adding the name of the image to the destination
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 26, 2006 Jul 26, 2006
filefield="thumbnailpic"

In the filefield attribute the file "thumbnailpic" is there, and this has the image to be uploaded
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 26, 2006 Jul 26, 2006
LATEST
Got it working
I forgot to set the form to enctype="multipart/form-data” … see below
<form name="b" action="xxx.cfm" method="post" enctype="multipart/form-data”>
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