I call the move_uploaded_file on my code twice but seems that the second one doesn't work.
If I interchange the position of them,
then first one will works, but the second won't.
any suggestion?
You can't move a file twice. Perhaps you are looking for copy(). When you move the file, the original doesn't exists anymore.
Docs: http://php.net/copy
You could use move_uploaded_file and copy the file from there again
Form PHP manual: move_uploaded_file — Moves an uploaded file to a new location
If I understand right, what you probably do is that when you first call move_uploaded_file function you move the uploaded file into a new location, then when you call move_uploaded_file function the second time the function does nothing because the file is moved already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With