?
Solved

fs.copy from virtual directory

Posted on 2012-03-20
7
Medium Priority
?
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
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 informatio…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

770 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