copy file to local hard drive

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tstimple
Forum Commoner
Posts: 53
Joined: Wed Jan 21, 2004 10:12 pm

copy file to local hard drive

Post by tstimple »

Is it possible (using file and/or FTP functions) to copy a file to my local c:drive?

--Tim
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

yes
tstimple
Forum Commoner
Posts: 53
Joined: Wed Jan 21, 2004 10:12 pm

Post by tstimple »

Thanks for explaining that so clearly!

Do you think you could provide an example?

Whenever I try to use the copy or fwrite functions I get a permissions error.
How do I overcome this?

I have used FTP to copy the file to my web server (where I can set a username & password). I now need to copy the file to my local hard drive. (I would rather write it directly to my local c: drive using an ftp fuction, but I seem to have the same permission denied error.

--Tim
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

why not jsut copy it straight off the server and not use code? Surely the server has a file manager??
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

why not save some time and just download a Ftp program? makes life much eaiser.
tstimple
Forum Commoner
Posts: 53
Joined: Wed Jan 21, 2004 10:12 pm

Post by tstimple »

I do have an FTP program.
I am trying to automate a process that has to happen everyday. This includes
1. downloading from ftp
2. Unzipping the downloaded file
3. Reading the extracted file into a table
4. mainipulate that table
5. Uploading the table to mysql

so far, i do this all manually

--Tim
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

If possible, i would recommend doing all of the work in the server. Especially since the file is already there and you can use php and send the table to the mysql server straight from there.
tstimple
Forum Commoner
Posts: 53
Joined: Wed Jan 21, 2004 10:12 pm

Post by tstimple »

That is what I have been working on. The problem is that I have not found a php method to extract a passworded zip file.

Any ideas?

--Tim
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

what operating system is the server running on?
tstimple
Forum Commoner
Posts: 53
Joined: Wed Jan 21, 2004 10:12 pm

Post by tstimple »

unix/apache
Post Reply