By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,292 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

PHP copy to local machine?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a

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

P: n/a

"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

P: n/a
> 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

P: n/a
*** 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 discussion thread is closed

Replies have been disabled for this discussion.