Solved

fs.copy from virtual directory

Posted on 2012-03-20
7
277 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
alert(innerHTML); 8 33
VMWare Calculate number of processors 10 70
JQuery Autocomplete Tag AJAX (Need nice script) 11 37
MS SQL and column defined as time 7 14
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…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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