copy in 2 directories

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Davide

    #1

    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

  • dbunny
    New Member
    • Jun 2006
    • 5

    #2
    Gee, wouldn't it be nice if everything were easy

    No... I don't think so. Look in the PHP manual for $_FILES and is_uploaded_fil e()

    Tells whether the file was uploaded via HTTP POST


    Copy moves files around the file system.
    Last edited by dbunny; Jun 14 '06, 08:18 AM. Reason: typo

    Comment

    • the DtTvB

      #3
      Re: copy in 2 directories

      copy($file, "/directory1/$superdat_name" );
      copy($file, "/directory2/$superdat_name" );
      // Just do copy 2 times.

      Comment

      • Janwillem Borleffs

        #4
        Re: copy in 2 directories

        Davide schreef:[color=blue]
        > copy("$file", "/directory1/$superdat_name" )
        >[/color]

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




        JW

        Comment

        Working...