473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

copy in 2 directories

Hi all.

I've got a simple question.
Is it possible with the command "copy" upload a file via browser on two
different directories?

I use copy

copy("$file", "/directory1/$superdat_name")

Thanx

Jun 14 '06 #1
3 1137
dbunny
5
No... I don't think so. Look in the PHP manual for $_FILES and is_uploaded_file()

http://php.net/is_uploaded_file

Copy moves files around the file system.
Jun 14 '06 #2
copy($file, "/directory1/$superdat_name");
copy($file, "/directory2/$superdat_name");
// Just do copy 2 times.

Jun 14 '06 #3
Davide schreef:
copy("$file", "/directory1/$superdat_name")


In addition to the other reply in this thread, for uploaded files, you
should use the move_uploaded_file() function instead.

http://www.php.net/move_uploaded_file
JW
Jun 14 '06 #4

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

Similar topics

1
by: Antonio Lopez Arredondo | last post by:
hi all !!! I need to copy a folder and its subfolders to another location; which class should I use ? could only find the System.IO.Directory.MOVE but don't know how to COPY. thanks in...
4
by: Ben Reese | last post by:
I need to copy (not move) a directory and all of its contents to another Location Disk / Server / Universe etc. But I cannot find a Copy method on the Directory or DirectoryInfo objects only a...
8
by: Ram Baruch | last post by:
Hi, I'm trying to use the File.Copy() function. It works well when the desenation file is local (Like: C:\dest\dest.exe). The problem is that when I'm trying to copy to a destenation that starts...
8
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if...
10
by: yinglcs | last post by:
Hi, Is there a c library which does shutil.copy2() in python? Basically copy a file from 1 directory to another? import shutil import os shutil.copy2(r"C:\test\test",r"C:\test1\test")
1
by: shapper | last post by:
Hello, I have the following code: <Target Name="AfterBuild"> <MakeDir Directories="$(OutputPath)\B" /> <Copy SourceFiles="$(OutputPath)\A\*.*" DestinationFolder="$ (OutputPath)\B" />...
2
by: manishabh77 | last post by:
can anyone suggest how I can find files in directories and subdirectories and copy them into a new directory.I tried the following code but it doesnot do the job. $inputfile1 = "file_index.txt"; ...
1
by: kumarboston | last post by:
Hi all, I am trying to copy couple of directories and their files to another place. Each directory have 25-30 files and numbered accordingly, the problem I am facing is, I have to copy files...
2
by: xahlee | last post by:
In this week i wrote a emacs program and tutorial that does archiving a website for offline reading. (See http://xahlee.org/emacs/make_download_copy.html ) In the process, i ran into a problem...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.