Solved

How do I make my web server copy a file?

Posted on 1998-08-13
2
151 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
perl script to count sepecial characters in a file 7 148
PERL export multiple query results to a JSON file 1 188
crawling gofundme 4 151
add a syntax to a csv file 8 101
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

739 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