Page 1 of 1

Copy Remote Files Error

Posted: Wed Feb 02, 2011 8:52 pm
by CMangano
We are currently running Apache on Windows and we have a process that copies a PDF file from a remote virtual directory (\\xxx.xxx.xxx.xxx) to our web server and everything works fine.

We would like to switch to running our site in IIS rather than Apache on windows. We cloned our current web server to an other VM share and now this copy process does not work. Our configuration is IIS6, FastCGI, CakePHP and PHP 5.3. The error we get is function copy: Failed to open stream: Invalid argument. The block of code is:

copy($remotepath, $localpath);

I am thinking it may be related to the permissions of the IUSR account on IIS but cannot figure out what is wrong. Does anyone have experience with copying remote files this way using IIS?

Hopefully I put in all the necessary info, but if you need me to expand on anything or need more information let me know.

Thanks,
Chris

Re: Copy Remote Files Error

Posted: Wed Feb 02, 2011 9:52 pm
by requinix
I don't think you'd get an "Invalid argument" error. More like an "Access denied". But it's worth checking the permissions - they do have to be set correctly anyways, it's just that you might not have encountered that error yet.

Double-check your $localpath value.

Re: Copy Remote Files Error

Posted: Thu Feb 03, 2011 10:30 am
by CMangano
That is the error that is printed to the screen. We have everyone set to full control for testing purposes on both directories and it still won't copy. Is there something that needs to be turned on in IIS that we may be missing?

Re: Copy Remote Files Error

Posted: Thu Feb 03, 2011 10:32 am
by John Cartwright
You will have to add all the neccesary IIS user groups to the folder your trying to write to.

Re: Copy Remote Files Error

Posted: Thu Feb 03, 2011 10:52 am
by CMangano
Thanks John but I added IIS_WPG and IUSR accounts with full control and still getting the same thing. On the server running apache we upgraded it to the latest version and we had to have the service run as our network admin account for this process to work which is why I suspect it may be a setting within IIS.

Re: Copy Remote Files Error

Posted: Thu Feb 03, 2011 10:55 am
by John Cartwright
CMangano wrote:Thanks John but I added IIS_WPG and IUSR accounts with full control and still getting the same thing. On the server running apache we upgraded it to the latest version and we had to have the service run as our network admin account for this process to work which is why I suspect it may be a setting within IIS.
Ah.. then I don't know, sorry. Just another reminder on why I avoid IIS like the plague :D