Solved

fs.copy from virtual directory

Posted on 2012-03-20
7
266 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now