Current location: Hot Scripts Forums » General Community » Script Requests » File Copying and rename script


File Copying and rename script

Reply
  #1 (permalink)  
Old 05-22-06, 07:24 PM
soundman87 soundman87 is offline
New Member
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
File Copying and rename script

Hi

What I am looking for a script that will:
-list the contents of a directory
-user then clicks on a file he wants
-the script then copies that file to a different directory
-replacing the existing file using the same file name of the one being replaced

Basicly I am making an audio archive to church sermons on the internet. I have a web based audio file player that uses the file names in the player library. So what I do is upload the audio file using ftp (because they are to big for an uploader script on my server). But I have a person who every week grabs the current sermon for playing on the radio, but it needs to always have the same file name every week. So I want so make this as idiot proof as possible for the person adding a new sermon. I could do this all throught ftp if I had to but a script would keep it consistent.

Jeff
Reply With Quote
  #2 (permalink)  
Old 05-22-06, 08:31 PM
Barnz1986 Barnz1986 is offline
Aspiring Coder
 
Join Date: Jan 2006
Posts: 506
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by soundman87
Hi

What I am looking for a script that will:
-list the contents of a directory
-user then clicks on a file he wants
-the script then copies that file to a different directory
-replacing the existing file using the same file name of the one being replaced

Basicly I am making an audio archive to church sermons on the internet. I have a web based audio file player that uses the file names in the player library. So what I do is upload the audio file using ftp (because they are to big for an uploader script on my server). But I have a person who every week grabs the current sermon for playing on the radio, but it needs to always have the same file name every week. So I want so make this as idiot proof as possible for the person adding a new sermon. I could do this all throught ftp if I had to but a script would keep it consistent.

Jeff
I could code this for you. For a price though I cannot do it for free.
Reply With Quote
  #3 (permalink)  
Old 05-23-06, 10:53 AM
soundman87 soundman87 is offline
New Member
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the responce

But at this point I am not yet willing to pay for script to be made. I know some people that could make it at a price for me if I have to.
Reply With Quote
  #4 (permalink)  
Old 05-23-06, 11:47 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Here an example

PHP Code:

<?php


$maindir 
".";                        // Where are the files?
$newdir "./copy";                 // Where should the files be copied at?
$file_filter = array(".""..");    // These files won't be displayed

###################################

$dir opendir($maindir);

if (isset(
$_GET['copy']) && file_exists($maindir .'/'$_GET['copy']))
{
    
copy($maindir .'/'$_GET['copy'], $newdir .'/'$_GET['copy']);
}

echo 
'<ul>';

while ((
$file readdir($dir)) !== false)
{
    if (!
in_array($file$file_filter))
    {
        echo 
'<li><a href="'$PHP_SELF .'?copy='$file .'">'$file .'</a></li>'"\n";
    }
}

echo 
'</ul>';

?>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.