Hi guys,
I want to move Excel file from one folder into another one. I am using following codes:
<?php
$file = "/uploaded/DMZ/newTest.txt";
$newlocation= "/uploaded/scanned/newTest.txt";
rename($file, $newlocation);
?>
Nothing happening when I execute the code.
Many thanks
move file to new location
Moderator: General Moderators
- hypedupdawg
- Forum Commoner
- Posts: 74
- Joined: Sat Apr 10, 2010 5:21 am
Re: move file to new location
I reccommend that you read this page: http://www.w3schools.com/php/func_filesystem_rename.asp, as well as looking at the php filesystem reference. It looks like this would be the best option for you - as long as you are uploading by the $_POST method.
PS: It is better for everyone concerned if you post your code inside the php tags provided - click the "PHP Code" button when writing a post. That way it can be expanded, hidden, etc.
Code: Select all
$file = "/uploaded/DMZ/newTest.txt";
$newlocation= "/uploaded/scanned/newTest.txt";
move_uploaded_file($file, $newlocation);Re: move file to new location
Thx guys, it was permission issue.
Thank you for your time,
Thank you for your time,