Solved

fs.copy from virtual directory

Posted on 2012-03-20
7
279 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
Technology Partners: 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 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
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…

734 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