473,978 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

moving a existing file from one folder to another



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_f ile() but it didn't work any ideas?
Thanks...

Apr 13 '06 #1
14 9364
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_f ile() 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_f ile().

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 13 '06 #2
You need rename(), I believe.

Apr 13 '06 #3
Coul also use link() and unlink()

Apr 13 '06 #4
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** **************@ u72g2000cwu.goo glegroups.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

Apr 13 '06 #5

Good Man wrote:
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** **************@ u72g2000cwu.goo glegroups.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).

Apr 13 '06 #6
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** *************@g 10g2000cwb.goog legroups.com:

Good Man wrote:
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** **************@ u72g2000cwu.goo glegroups.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.

Apr 18 '06 #7

Good Man wrote:
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** *************@g 10g2000cwb.goog legroups.com:

Good Man wrote:
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** **************@ u72g2000cwu.goo glegroups.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.

Apr 18 '06 #8
"Chung Leong" <ch***********@ hotmail.com> wrote in
news:11******** **************@ i39g2000cwa.goo glegroups.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?

Apr 18 '06 #9
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.

Apr 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5526
by: Stephen Ghelerter | last post by:
I am moving a web site with a MySql database to another server. Can I create a database on the new server with the same name and then move the tables there, or is life not that simple? Or can I create tables with no data and then replace them with the files from the other server? I know I can export them as text files and them import them, but that is a lot of trouble. Also, using my FTP program I can't access the mysql folder on the...
6
1928
by: Tim | last post by:
I am in the process of moving a site from one hosting company to another. This site is fairly large, with hundreds of asp files, each with multiple "include" statements. The new host has a different webspace folder structure for it's clients than the old host. At the moment, this is forcing me to have to append all the paths for all the include statements (not to mention all the other path-related code) to make things work. Example:
6
8976
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? I am running UDB 8.2 on Linux and AIX. Thanks.
11
7758
by: Dave | last post by:
I copied the project files from an ASP.NET project on one computer and want to create the project on another computer, There is no connection between the two computers so I simply copied the project files from the first computer onto a memory stick and then from the memory stick into my Visual Studio Projects folder on the second computer. But when I open Visual Studio on the second computer and try to create a project by pointing to...
4
1931
by: Martin | last post by:
Hi! How do I move a project (all sources) to a different location. Currently it is located in 'My Documents', but I would like to move it to a directory on the server. When I try the "Save As..." option on the vbproj-file, VS2005 tells me that it can be in the current directory only... Tia, Martin
2
2365
by: RSH | last post by:
Hi, I am having a little trouble with a Visual Studio project. I moved and existing project to a Network share and now when I go to run the project in Debug mode I get an error saying "The operation could not be completed. The process cannot access the file because it is being used by another process." Then when I try to run the project again I get another error that reads "Visual Studio could not copy a support file to this location:...
2
2068
by: Rob Dob | last post by:
Hi, How do I go about installing another Web Site Project inside my existing VS2005 website project. I currently have both a forum WSP and my main WSP application within the same solution. Both compile and run without error. However they are separate applications and I would like to have them together in order to make use of my masterpages, and share controls between. Do I need to combine the web.config files? I figured I would just...
2
1313
by: conics | last post by:
is it possible to move a folder from 1 directory to another this is the situation, i created a database file and then the database depends on the folder which is of course has the same name as the file database name its dependencies are on this folder. and i have to move the database and its dependencies in to another folder, can i move the folder? c:\vb projects\part1 db1.db(database) db1(folder) ..db1files
8
1775
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
Hello group. I have some code (given to me), but I don't know alot about ASP, so I was hoping someone here can help. Running on Win 2008 server. The code below will scan a folder and subfolder with a date/time input and return xml structure off all files that are newer than the supplied date/time. The problem is that the returned xml has path names like C:\folder\subfolder\filename.ext I would like it to be more like...
0
10356
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11413
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11582
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6561
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5161
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3765
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.