473,890 Members | 1,391 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 9356
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
5519
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
1922
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
8946
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
7748
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
1927
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
2361
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
2064
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
1310
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
1768
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
9826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11234
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
10829
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
10925
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
8018
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
7171
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5854
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6058
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4682
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

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.