complex05 Posted January 23, 2007 Share Posted January 23, 2007 Hello,I'm currently using a perl script to upload files (i'm using perl so I can use an AJAX progress bar) however since I don't know perl at all and have no desire to, I would like to use a PHP script to do what I want to do.Right now, the perl script uploads the files to /uploads/ then redirects to a page called finished.php. I need the files to go to different directories depending on who is logged into the system. I need to know how to move a file to a different directory in PHP. Is there a function to do this?Thanks,Barry Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 23, 2007 Share Posted January 23, 2007 move_uploaded_files()That is used to move newly uploaded files to a directory. As far as moving current files on the server, to new locations on the server, you need to open the file, copy it, create a new file, paste the information in htere, and save the new file in the new location, and then delete the old file.Unless php has a way to just copy file's, then delete the old one, not sure. Quote Link to comment Share on other sites More sharing options...
complex05 Posted January 23, 2007 Author Share Posted January 23, 2007 yeah I can't use move_uploaded_files() because the perl script has already uploaded it and moved it. I'm aware of the open, read, copy, save and delete method but some of these files are 25MB+... don't wanna break my server :( Quote Link to comment Share on other sites More sharing options...
trq Posted January 23, 2007 Share Posted January 23, 2007 [url=http://php.net/rename]rename[/url]() will move a file. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 23, 2007 Share Posted January 23, 2007 It will?Thanks I will keep that in mind as well, I always used the long method Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.