This is a discussion on moving a existing file from one folder to another within the PHP Language forums, part of the PHP Programming Forums category; Lets say i have a file with the name atest.doc and its in the directory www/directory1 but i ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Lets say i have a file with the name atest.doc and its in the directory www/directory1 but i want to move that file using php to www/directory2/ how do i do this i tried move_uploaded_file() but it didn't work any ideas? Thanks... |
|
|||
|
Realtime wrote:
> > > Lets say i have a file with the name atest.doc and its in the directory > www/directory1 but i want to move that file using php to > www/directory2/ how do i do this i tried > > move_uploaded_file() but it didn't work any ideas? > > > Thanks... > > > Do it with telnet (ssh) or ftp. The file wasn't (just) uploaded, so you can't move it with move_uploaded_file(). -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
"Chung Leong" <chernyshevsky@hotmail.com> wrote in
news:1144902014.393228.323980@u72g2000cwu.googlegr oups.com: > You need rename(), I believe. keep in mind that rename() is useless on windows boxes: http://ca3.php.net/manual/en/function.rename.php#59570 |
|
|||
|
Good Man wrote: > "Chung Leong" <chernyshevsky@hotmail.com> wrote in > news:1144902014.393228.323980@u72g2000cwu.googlegr oups.com: > > > You need rename(), I believe. > > keep in mind that rename() is useless on windows boxes: > http://ca3.php.net/manual/en/function.rename.php#59570 Have you tested this yourself? I haven't seen anything of the sort described. Rename worked as it should (on WinXP). |
|
|||
|
"Chung Leong" <chernyshevsky@hotmail.com> wrote in
news:1144971325.768368.59470@g10g2000cwb.googlegro ups.com: > > Good Man wrote: >> "Chung Leong" <chernyshevsky@hotmail.com> wrote in >> news:1144902014.393228.323980@u72g2000cwu.googlegr oups.com: >> >> > You need rename(), I believe. >> >> keep in mind that rename() is useless on windows boxes: >> http://ca3.php.net/manual/en/function.rename.php#59570 > > Have you tested this yourself? I haven't seen anything of the sort > described. Rename worked as it should (on WinXP). hi yes, sorry, that comment refers to renaming FOLDERS as useless/totally buggy on windows; renaming files works properly. |
|
|||
|
Good Man wrote: > "Chung Leong" <chernyshevsky@hotmail.com> wrote in > news:1144971325.768368.59470@g10g2000cwb.googlegro ups.com: > > > > > Good Man wrote: > >> "Chung Leong" <chernyshevsky@hotmail.com> wrote in > >> news:1144902014.393228.323980@u72g2000cwu.googlegr oups.com: > >> > >> > You need rename(), I believe. > >> > >> keep in mind that rename() is useless on windows boxes: > >> http://ca3.php.net/manual/en/function.rename.php#59570 > > > > Have you tested this yourself? I haven't seen anything of the sort > > described. Rename worked as it should (on WinXP). > > hi > > yes, sorry, that comment refers to renaming FOLDERS as useless/totally > buggy on windows; renaming files works properly. Renaming folders works too. |
|
|||
|
"Chung Leong" <chernyshevsky@hotmail.com> wrote in
news:1145385967.253288.226700@i39g2000cwa.googlegr oups.com: >> >> > You need rename(), I believe. >> >> >> >> keep in mind that rename() is useless on windows boxes: >> >> http://ca3.php.net/manual/en/function.rename.php#59570 >> > >> > Have you tested this yourself? I haven't seen anything of the sort >> > described. Rename worked as it should (on WinXP). >> >> >> yes, sorry, that comment refers to renaming FOLDERS as useless/totally >> buggy on windows; renaming files works properly. > > Renaming folders works too. ahhh, but read the note. Yes, the folders are sort of 'renamed' - but did you compare the contents of your 'renamed' folder to the 'original' folder?: "If you're trying to rename a directory, files within the directory will NOT be present in the renamed directory, though sub-directories WILL be present. Ultra-strange. And as noted, your 'old' directory will remain on the server totally intact, which can be very confusing." confirm? |
|
|||
|
Good Man wrote:
> ahhh, but read the note. Yes, the folders are sort of 'renamed' - but did > you compare the contents of your 'renamed' folder to the 'original' > folder?: > > "If you're trying to rename a directory, files within the directory will > NOT be present in the renamed directory, though sub-directories WILL be > present. Ultra-strange. And as noted, your 'old' directory will remain on > the server totally intact, which can be very confusing." > > confirm? Yes, it works as it's supposed to. Go test it yourself. |