1) you have 2 form fields - one hidden field and one file field - with
same name. if you cfdump your form on your action page you will see that
form.movie_picture has a value something like "oldfilename, " - a
comma-delimited list. thus it will not be empty, and your action page
will try to run the file upload code. give your hiden field a different
name, like old_picture or something.
2) there is no need to use those # inside cfset and cfif. it is a bad
practice.
4) you should use CFFILE instead of FILE to access the results of CFFILE
actions. FILE reference has been deprecated a long time ago...
3) what exactly are you doing with this line: <CFSET
#Form.movie_picture#=#File.ServerFile#> ? and why? there will be no need
for this if you have your fields named uniquely.

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Don R Seibert wrote:
> To All,
>
>  
>
> I have a template that uploads a jpg file to a directory on the server
> and puts the name of the file into the database. That part works fine.
> The part I am having a problem with is I have a template that will edit
> the record from the database. It does not seem to be keeping the name of
> the file after I submit the edited record. Here is the code that I am
> using for the form and the action page.
>
>  
>
> This is the form:
>
>  
>
> <img src="../movieposters/#movie_picture#"><input type="hidden"
> name="movie_picture" size="50" value="#movie_picture#"><br>
>
>                                                 <label
> for="movie_picture" class="label">Movie Poster</label><input type="file"
> name="movie_picture"> <br>
>
>  
>
> This is the action page:
>
>  
>
> <cfif #form.movie_picture# IS NOT "">
>
> <CFFILE ACTION="upload"
>
> DESTINATION="C:\Inetpub\wwwroot\TwoDudesMovieReviews\movieposters\"
>
> FILEFIELD="movie_picture"
>
> NAMECONFLICT="overwrite">
>
> <CFSET #Form.movie_picture#=#File.ServerFile#>
>
> </CFIF>
>
>  
>
> What am I doing wrong.
>
>  
>
> Thank you.
>
>  
>
> Don Seibert
>
> SeiberSpace Technologies, LLC
>
> www.seiberspace.net
>
>                                 
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305587
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