Solved

fs.copy from virtual directory

Posted on 2012-03-20
7
272 Views
Last Modified: 2012-04-09
Hi Gents,

I have a problem copying a file from one folder to another using the file system fs.copy.

As part of an asp upload I need to manipulate some files but when I try to do the following :

fs.CopyFile "c:\Inetpub\wwwroot\PLC_PROGRAMS\" & filename,"c:\Inetpub\wwwroot\PLC_BACKUP\"

I get a permission denied error. If I change the address to let's say :

fs.CopyFile "c:\uploads\PLC_PROGRAMS\" & filename,"c:\uploads\PLC_BACKUP\"

then the code has no problems whatsoever.

All the permissions are set and enabled for the above virtual directory yet I still have the error. Any help would be appreciated.
0
Comment
Question by:Latzi_Marian
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:nap0leon
ID: 37747146
Curious... does it work if it is not a virtual directory?

I encountered the same issue when trying to save files into my c:\inetpub\wwwroot folder and all sub-folders (even though I have no virtual directories).

This was a permissions issue I was able to resolve by right-click wwwroot, properties - security.
Check the permissions for your Internet Guest Account (IUSR_blahblahblah).
0
 

Author Comment

by:Latzi_Marian
ID: 37747238
Yes it does work if it is not a virtual directory. I also set the permissions of the wwwroot for the IUSR_blablabla user as well.

I simply cannot understand what the problem is
0
 
LVL 18

Expert Comment

by:nap0leon
ID: 37747271
Do you mean PLC_PROGRAMS is not an actual directory?  I was originally thinking you meant a virtual directory inside IIS...

If "PLC_PROGRAMS" is not a physical directory on the machine, and actually is a "shortcut" to some other location, then you cannot copy a file to it directly like that.  There are several good programs that will let you copy stuff to linked directories on UNIX and a couple mediocre ones for Windows, but I have not seen any way to do it inside of IIS.

Since the linked directory is actually a pointer, it is like trying to copy a file into the pointer (versus copying the file to where the pointer is pointing to).  It does not actually follow to the pointers location.  

Perhaps you can use a .cmd file that does the copy for you.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Latzi_Marian
ID: 37747301
Sorry sorry. Not sure why I called the "PLC_PROGRAMS" directory a virtual directory it is actually a physical directory in the wwwroot directory.I use that directory to "store" some files and download these files through a web interface.

I also tried to make a new directory  with a different name and try to do the copy but it didn't work.

 No fs.copy works if it is inside the c:\ inetpub\wwwroot directory. As soon as I try to do the fs.copy outside this directory everything's good.

Seems to be a permission issue but as I said I set all the necessary permissions for the IUSR_...
user
0
 
LVL 18

Accepted Solution

by:
nap0leon earned 500 total points
ID: 37747601
To be sure we aren't missing the obvious... have you double-checked the permissions on the PLC_BACKUP folder?
0
 

Author Comment

by:Latzi_Marian
ID: 37762457
yes checked everything multiple times. All permissions are set for the PLC_BACKUP folder,including the most important one IUSR_.........
0
 

Author Closing Comment

by:Latzi_Marian
ID: 37825964
Hi. Got it sorted .It just took a while to get back to the PC where I had this problem. I had to run the permissions wizzard in XP for some reason to get it working. If I did set the permissions manually it simply would not work.This is a very nice feature of XP by the looks of it.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question