Jump to content

PHP Move File to New Directory


complex05

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/35370-php-move-file-to-new-directory/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.