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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.