Saving file to server in ColdFusion -


after doing research feel should work, not saving file images directory.

    <cfform name="uploadimgform" method="post" action="#cgi.path_info#?#cgi.query_string#" enctype="multipart/form-data">     <input name="txtimg" type="file" />     <input name="btnsubmit" type="submit" /> </cfform> <cfif isdefined("form.txtimg")>     <cffile action="upload"         filefield = "txtimg"         destination="/images"         accept="image/jpeg"         nameconflict="makeunique"> </cfif> 

i plan on doing validation, simple example working first.

i came across later helpful when trying rename file before upload: adobe link

the destination has full path, otherwise gets sent directory relative temp directory of coldfusion.

try this:

<cfset destination = expandpath("images") />  <cffile action="upload"     filefield = "txtimg"     destination="#destination#"     accept="image/jpeg"     nameconflict="makeunique"> 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -