473,508 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to copy file from one source to other source?

79 New Member
Hi,

I am uploading a zipfile and i want to copy the file to some other directory i tried like this.

Here is the html code:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <form method='POST' enctype='multipart/form-data' action='/cgi-bin/zip.pl'>
  4.  
  5. File to upload: <input type=file name=upfile><br>
  6. Notes about the file: <input type=text name=note><br>
  7. <br>
  8. <input type=submit value=Press> to upload the file!
  9. </form>
  10. </body>
  11. </html>
  12.  
Expand|Select|Wrap|Line Numbers
  1.  
  2. $param=param("upfile");
  3. system("cp $param /var/www/cgi-bin/Other/");
  4.  
  5.  
But i couldn't copy the zipped file!!!

How can i copy the file and unzip the directory?

I don't want to use any modules!!!

Regards
Archana
Jan 30 '09 #1
2 2021
numberwhun
3,509 Recognized Expert Moderator Specialist
@Archanak
I know that you said you don't want to use any modules, but why, you already are? The param() function is part of the CGI module. If you aren't using the CGI module, then that function is useless to you, unless you have defined it yourself, somewhere else.

As for the copy, unless the user specifies a directory with the file name, the file would have to be in the directory local to where the script is.

Did you see any errors?

Regards,

Jeff
Jan 30 '09 #2
KevinADC
4,059 Recognized Expert Specialist
If you want to move a file from one directory to another you can use perls rename() function. See the rename() manpage for details. As far as unzipping the file I guess you can use whatever program the server has installed for that if you don't want to use a module. But thats not a perl question then.
Jan 30 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

75
8196
by: Massimo | last post by:
I'm planning to develop a .NET application using C#, in order to sell it as a shareware and/or as a full package, so I'll need a good way to protect it against piracy. I know some ways to protect...
6
3265
by: Tom | last post by:
I am having trouble when I read a file and another process is trying to update it. So I need a rountine to copy a file in asp.net. Can anyone assist? Thanks Tom
1
3880
by: POnfri | last post by:
Hi, I have a problem in a peace of code were i'm doing a file copy using File.Copy. The Source is local and the target is a remote machine. Example: File.Copy(C:\temp\hi.txt,...
2
5495
by: Pete Davis | last post by:
I'm getting an exception when trying to copy a file. I basically do a File.Copy(source, dest, false); source is the source full path and filename. dest is the destination full path and...
4
2148
by: Steve Richter | last post by:
can File.Copy be use to copy files from my PC to the file system at my shared hosting web site? If so, what is the format of the path name of the file on the web site? The idea being that if I...
2
3763
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
3
4033
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
12
2518
by: samoore33 | last post by:
I found a real nice article on how to copy a directory on MSDN. The only problem is that I can not figure out how to get the namespace Microsoft.VisualBasic.MyServices. I wanted to know if anyone...
22
3587
by: clicwar | last post by:
A simple program with operator overloading and copy constructor: #include <iostream> #include <string> using namespace std; class Vector { private: float x,y; public: Vector(float u, float...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.