473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

PHP copy to local machine?

Hello,

I am building a small page to copy files from our server(s) to our users
local machines. It's very simple...
(below, "f" is a mapped network drive)

<?php

$source_file = 'f:\somefile.whatever';
$destination_path = (I want to move it to the USERS
C:\somedirectory\somefile);

copy($source_file, $destination_path);

?>

How can I accomplish this? Thanks for any help!!
Jul 17 '05 #1
4 4235

Somedude wrote:
Hello,

I am building a small page to copy files from our server(s) to our users local machines. It's very simple...
(below, "f" is a mapped network drive)

<?php

$source_file = 'f:\somefile.whatever';
$destination_path = (I want to move it to the USERS
C:\somedirectory\somefile);

copy($source_file, $destination_path);

?>

How can I accomplish this? Thanks for any help!!


You can't accomplish this using PHP. Remember PHP runs on the SERVER,
which I assume is a different machine than the user's local machine.
The best you could do would be to copy it to a networked directory that
is accessible by both the webserver process and each user.

You might be able to create a Javascript script via PHP and an HTML
source file that invokes it, then switch control to that file to do the
copy.

Ken

Jul 17 '05 #2

"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

Somedude wrote:
Hello,

I am building a small page to copy files from our server(s) to our

users
local machines. It's very simple...
(below, "f" is a mapped network drive)

<?php

$source_file = 'f:\somefile.whatever';
$destination_path = (I want to move it to the USERS
C:\somedirectory\somefile);

copy($source_file, $destination_path);

?>

How can I accomplish this? Thanks for any help!!


You can't accomplish this using PHP. Remember PHP runs on the SERVER,
which I assume is a different machine than the user's local machine.
The best you could do would be to copy it to a networked directory that
is accessible by both the webserver process and each user.

You might be able to create a Javascript script via PHP and an HTML
source file that invokes it, then switch control to that file to do the
copy.

Ken


Thanks Ken. I do have local FTP available on the network. Would I be able
to accomplish this task now?
Jul 17 '05 #3
> Thanks Ken. I do have local FTP available on the network. Would I be
able
to accomplish this task now?


Hi,
With FTP, no problem, you can do that easily..
Hav a look to " ftp_* php functions
bye
Jul 17 '05 #4
*** Somedude wrote/escribió (Mon, 9 May 2005 09:40:45 -0400):
Thanks Ken. I do have local FTP available on the network. Would I be able
to accomplish this task now?


If you can you use FTP at the server to upload files to user's computers,
you can do it with PHP. However, I doubt you have an FTP server installed
and running on every computer.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: oceanhai | last post by:
We currently have a PPTP connection set up for our developers to access our development SQL server through a VPN tunnel. When they need to copy tables up to the dev SQL from their local machine...
2
by: len | last post by:
I am in a situation where I need to get a copy of test database that is on production server running MSSQL 2000 Standard to my local machine running MSSQL 2000 personel. I tried to use the copy...
1
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,...
9
by: Kristijan Marin | last post by:
Hi, Does anyone know how to copy files inside network from mashine one to mashine2 if the mashine2 requires user/pass authentication ?? I need this for Windows platform. Anyone did that ? ...
3
by: Johnny | last post by:
Hi, I have created an ASP.NET application (let's call it FooBar) with VS.NET on my local machine, residing in http://localhost/FooBar. Deploying it to another folder on my machine works well...
2
by: Steve Franks | last post by:
The Copy Web tool provided with VS.NET 2005 is very convenient. However every once in a while it seems to think the files on the remote server have changed, which they have not. Then when I use...
3
by: ll | last post by:
Hi, I have copied a MS SQL database to my local machine and am testing it with ASP pages, locally, on IIS. I have a db connect page that keeps the current connections for the live database. My...
1
by: ll | last post by:
Hi, I have copied a MS SQL database to my local machine and am testing it with ASP pages, locally, on IIS. I have a db connect page that keeps the current connections for the live database. My...
5
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post by:
Hello! I'm trying to copy a file from another computer on the network that I do not have permission with my current logon details to access. If I open the folder using the Windows file manager...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.