1

I'm trying to upload an image to my server and the destination attribute of cffile is adding the tmp directory to the front of my destination path.

I know from another question on here that

The destination has to be a full path, otherwise it gets sent to a directory relative to the temp directory of ColdFusion.

But I am using the full server path. I'm in a Unix environment so its starting with /var/www/mywebsite...

This is true because it even outputs the path

/opt/coldfusion8/runtime/servers/coldfusion/SERVER-INF/temp/wwwroot-tmp/\var\www\mywebsite\Gallery\

You can see where the tmp folders are and my intended destination.

I am also working on the right line, because when I enter different values for my intended destination, they reflect as such in the error output.

ale
  • 6,369
  • 7
  • 55
  • 65
d.lanza38
  • 2,525
  • 7
  • 30
  • 52
  • Try dumping out the result of `expandPath("/var/www/mywebsite")` and see what that gives you. – ale Mar 13 '12 at 18:15

1 Answers1

4

It looks like you are using backslashes in your path attribute. You didn't post any code, so I am guessing, but it looks liek your cffile looks like

<cffile destination="\var\www\mywebsite\Gallery\" ... />

You should always use front slashes, especially on *nix

<cffile destination="/var/www/mywebsite/Gallery/" ... />
Jason Dean
  • 9,585
  • 27
  • 36
  • Yeah, I thought that was weird. What going on is I'm moving these sites from an old server to a new one. They worked perfectly fine on the old but now that they are on the new server they just broke. Different version of coldfusion but I think it was from unix to unix. I don't even really program in cf to top it off. Anyway, I'm going to try "/" instead of "\" to see if that solves it. – d.lanza38 Mar 13 '12 at 18:12
  • That did the trick. I knew this was working as is at some point, and since I don't use cf much, I figured it was supposed to be that way. Thank you for all your help. – d.lanza38 Mar 13 '12 at 18:46