judsonmusic
asked on
cfimage not working
can someone tell me why this isnt working??? I ma gettin an error that says the destination directory doesnt exist but it does!
<cfset imagename = listlast(form.filename,"\" )>
<cfif #IsDefined("FORM.file")# AND #FORM.file# IS NOT ''>
<cffile
action="UPLOAD"
filefield="form.file"
destination="c:\websites\1 71210jc2\a dmin\event s\#session .folderpat h#\#imagen ame#"
nameconflict="makeunique">
<cfimage action="info" structname="imagetemp" source="c:\websites\171210 jc2\admin\ events\#se ssion.fold erpath#\#i magename#" >
<cfset x=min(200/imagetemp.width, 100/imagetemp.height)>
<cfset newwidth = x*imagetemp.width>
<cfset newheight = x*imagetemp.height>
<cfimage action="resize"
source="c:\websites\171210 jc2\admin\ events\jud sonmusic\# imagename# "
width="#newwidth#"
height="#newheight#"
destination="c:\websites\1 71210jc2\a dmin\event s\judsonmu sic\Thumb_ #imagename #">
</cfif>
<cfset imagename = listlast(form.filename,"\"
<cfif #IsDefined("FORM.file")# AND #FORM.file# IS NOT ''>
<cffile
action="UPLOAD"
filefield="form.file"
destination="c:\websites\1
nameconflict="makeunique">
<cfimage action="info" structname="imagetemp" source="c:\websites\171210
<cfset x=min(200/imagetemp.width,
<cfset newwidth = x*imagetemp.width>
<cfset newheight = x*imagetemp.height>
<cfimage action="resize"
source="c:\websites\171210
width="#newwidth#"
height="#newheight#"
destination="c:\websites\1
</cfif>
ASKER
I have narrowed it down to safari.
Safari doesnt like this:
<cfset imagename = listlast(form.filename,"\" )>
it outputs the full path for some reason but in FF and IE is just shows the file name.
WHY?????
Safari doesnt like this:
<cfset imagename = listlast(form.filename,"\"
it outputs the full path for some reason but in FF and IE is just shows the file name.
WHY?????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thats seems so work now I have 2 other questions I am going to post if you can help me with those as well???
We will see. I assume I will be able to help :-)
But please take a look one moment at the actual question. You replied that it "seams" to work. That is not acceptable. The purpose of my support is to get you learning from your question not to do your job and get your code working.
So my question to you is: do you see what mistakes you made in your code and did you learn what is the correct way of uploading files and generating server side uploaded file names?
But please take a look one moment at the actual question. You replied that it "seams" to work. That is not acceptable. The purpose of my support is to get you learning from your question not to do your job and get your code working.
So my question to you is: do you see what mistakes you made in your code and did you learn what is the correct way of uploading files and generating server side uploaded file names?
ASKER
yes it worked perfectly Im sorry
ASKER
<cfif #IsDefined("FORM.file")# AND #FORM.file# IS NOT ''>
<cffile
action="UPLOAD"
filefield="form.file"
destination="c:\websites\1
nameconflict="makeunique">
<cfoutput>
<cfimage source="c:\websites\171210
action="resize"
width="150"
height="200"
destination="c:\websites\1
overwrite = "true">
</cfoutput>
</cfif>
IT WORKS ON A WINDOWS MACHINE BUT NOT ON A MAC! WHY???::::::::::::::::::::
When i run it on a mac I get the following error:
An exception occured while trying to write the image.
Ensure that the destination directory exists and that Coldfusion has permission to write to the given path or file. cause : java.lang.NullPointerExcep
The error occurred in C:\Websites\171210jc2\admi
23 : width="100"
24 : height="100"
25 : destination="c:\websites\1
26 : overwrite = "true">
27 : </cfoutput>