Solved

How do I make my web server copy a file?

Posted on 1998-08-13
2
150 Views
Last Modified: 2010-03-05
I have an NT4 server running IIS3 and I have perl for win32 loaded on it. I have a form in a web page an when the user clicks on 'submit' I need my perl script to copy a file from one place to another on the web server itself, not on the client side.

I have tried the following, and they don't give errors, they just ignore the command.

system ("copy c:\test d:\test");
system ("cp c:\test d:\test");
cp "c:\test" "d:\test";
copy "c:\test" d:\test";
copy "c:\test d:\test";

Has anyone ever done this or know the correct syntax if it is possible?

Thanks.
0
Comment
Question by:johnsm
[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
2 Comments
 
LVL 4

Accepted Solution

by:
mitek earned 50 total points
ID: 1209268
i was about to write "most likely, it's permission problem", but it looks like it's much simpler.

i would suspect that backslash in
system ("copy c:\test d:\test"); is interpreted as a tab ( \t ),
so the names the copy command sees are totally bogus.

so, to "copy" it looks like "copy c:  est d:  est"

i would either double backslash or used single quotes

system ("copy c:\\test d:\\test");
system ('copy c:\test d:\test');
 
             

0
 
LVL 1

Author Comment

by:johnsm
ID: 1209269
Wow! Both suggestions worked fine.

I'm kinda new to this perl thing and I didn't even think of those.

Thanks a lot for your help.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

756 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