472,794 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 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 4196

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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.