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

network alias in write statements

Enthusiast ,
Sep 13, 2011 Sep 13, 2011

will this work

<cfset filename = "\\mule\ppc_margin\export\#DateFormat(now(), "yyyymmdd")&'-'&TimeFormat(now(), "HHmmss")#.xml">

<cfdump var="#filename#">
<cffile action='Write' file="#filename#" output='#data.xmlData[1]#'>

I keep getting acces denied

http://www.elyricsworld.com/don%27t_you_want_my_love_lyrics_nicole.html

1.1K
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

LEGEND , Sep 14, 2011 Sep 14, 2011

ah ok,do you know how to give permission to CF9 to write  on separate servers, Im not expert in windows folders permissions

btw is it ok to alias in filenames instead of mappings like c:   ext?

http://lmgtfy.com/?q=setting+directory+permissions+on+windows

And, yeah, using a UNC is fine.

--

Adam

Translate
LEGEND ,
Sep 13, 2011 Sep 13, 2011

Does the account CF is using have permissions to that resource?  By default, it won't have.

--

Adam

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
Enthusiast ,
Sep 14, 2011 Sep 14, 2011

ah ok,do you know how to give permission to CF9 to write  on separate servers, Im not expert in windows folders permissions

btw is it ok to alias in filenames instead of mappings like c:   ext?

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
LEGEND ,
Sep 14, 2011 Sep 14, 2011

ah ok,do you know how to give permission to CF9 to write  on separate servers, Im not expert in windows folders permissions

btw is it ok to alias in filenames instead of mappings like c:   ext?

http://lmgtfy.com/?q=setting+directory+permissions+on+windows

And, yeah, using a UNC is fine.

--

Adam

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
Enthusiast ,
Sep 14, 2011 Sep 14, 2011

ahahahaha google:

I tried the UNC path and confirmed with my IT guy that anything can write to server.

but I still get this: so strange, I even rdp'ed to the calling server and put  \\server\export\ into explorer and open fine

Service error debug:

faultCode:Server.Processing faultString:'Unable to invoke CFC - An error occurred when performing a file operation Write on file \\mule\ppc_FIS_Margin\export\rfm20110914006.xml.' faultDetail:'The cause of this exception was: java.io.FileNotFoundException: \\server\export\rfm20110914006.xml (Access is denied).'

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
Guide ,
Sep 14, 2011 Sep 14, 2011

If that's the case then I'm afraid your IT guy is wrong.

Make sure he knows that the user account under which the CF service runs has full network permissions over the share. As Adam says, it does not by default - even on a base install, it would be running as Local System, which does *not* have said permissions.

If he didn't need to change anything, I'd be very surprised if it has permissions.

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
Enthusiast ,
Sep 14, 2011 Sep 14, 2011

I think you IT guy is confusing the permissions on the destination with the capabilities of the source.  He may be right in saying that the

server and UNC that you are trying to write to allows everyone to write to it.  But what is doesn't realize that "everyone" doesn't really mean "everyone" - it really means "everyone who is allowed to even try to get to the network."  If an account on another server does not have network access then it is not going to get to your destination server because it cannot even get to the network.  On Windows before Windows Server 2008, the default service account that services like ColdFusion run under, that account does not have AND CANNOT BE GIVEN network privs.   So you need to create a new domain login for all of the CF services to run under, and then be sure that that domain account is given access to the shares on the remote servers that it needs to access.  In your case, since it sounds like the IT guy opened up the share that you are trying to access, then all he probably needs to do is to create the domain account for CF to use. Once you change the logins for the services, you need to restart each of them.  If you don't really want everyone in the world to get to your remote server share, then the IT guy can restrict its access to just the account that CF is running under.

In Windows server 2008 this does not seem to be a problem, since the local services account now has network access.

-reed

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
Enthusiast ,
Sep 15, 2011 Sep 15, 2011
LATEST

One of the best answers I ever got mate, thx so much!!!!

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