I have a script that uploads ifiles to a folder on my site, the thing is, i want it to automatically go in my album, i need a script when after uploading - it should automatically write a tex file i a serten xml file without deleting any files

i don't know what script to show but i will give the codes what i think you can use to see what i need


after uploading i want a script to write the target file and rewrite in xml file below


The xml looks something like these




<?xml version="1.0"?>
<MultimediaGallery>
<file type="audio">
<thumb>media/audio/thumbs/audio1.jpg</thumb>
<source>media/audio/audio1.ogg</source>
<source>media/audio/audio1.mp3</source>
<description>Audio Example</description>
</file>
<file type="video">
<thumb>media/videos/thumbs/video1.png</thumb>
<source>http://www.youtube.com/watch?v=irF02LNZLpE</source>
<description>Youtube Video: San Francisco Carnaval Grand Parade 2010</description>
</file>
<file type="video">
<thumb>media/videos/thumbs/video2.png</thumb>
<source>http://www.youtube.com/watch?v=dD1H4fvdnyI</source>
<description>Youtube Video: San Francisco Carnival Parade 2010 Best Video</description>
</file>
<file type="video">
<thumb>media/videos/thumbs/video3.png</thumb>
<source>http://www.youtube.com/watch?v=x4zjT-lfoXw</source>
<description>Youtube Video: Sambamora with Loco Bloco at the San Francisco Pride Parade</description>
</file>
<file type="photo">
<thumb>media/photos/thumbs/1.jpg</thumb>
<source>media/photos/1.jpg</source>
<description>this is a description</description>
</file>
<file type="photo">
<thumb>media/photos/thumbs/2.jpg</thumb>
<source>media/photos/2.jpg</source>
<description>this is a description</description>
</file>
</MultimediaGallery>



as you can i need these part to be rewrite after i upload
<file type="photo">
<thumb>media/photos/thumbs/1.jpg</thumb>
<source>media/photos/1.jpg</source>
<description>this is a description</description>
</file>


-------------------------

html php that uplads the file file that the uploads



<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="description" content="" />
<meta name="keywords" content=""/>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>
<link class="ui-theme" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/vader/jquery-ui.css"/>
<link rel="stylesheet" href="jMediaelement/css/styles.css" />
<link rel="stylesheet" href="jMediaelement/css/player-controls.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<!-- ui-components -->
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<!-- END: ui-components -->
<!-- optional for a11y-slider -->
<script src="jMediaelement/utils/a11y-slider.ext.js"></script>
<!-- END: for a11y-slider -->
<!-- jMediaelement -->
<script src="jMediaelement/packages/mm.full.min.js"></script>
<!-- jMediaelement -->
<!-- fullwindow plugin -->
<script src="jMediaelement/plugins/fullwindow.js"></script>
<!-- fullwindow plugin -->
<!-- useractivity -->
<script src="jMediaelement/utils/useractivity.js"></script>
<!-- jmeEmbedControls is a very simple plugin, that you should use as a starting point for your own theme -->
<script src="jMediaelement/utils/jmeEmbedControls.js"></script>
<style>
h1.title{
position:absolute;
top:5px;
left:-1px;
background-color:#000;
border:1px solid #111;
color:#666;
font-size:15px;
text-shadow:1px 1px 1px #000;
padding:10px;
background-color:#121212;
border:1px solid #292929;
-moz-border-radius:0px 5px 5px 0px;
-webkit-border-bottom-right-radius:5px;
-webkit-border-top-right-radius:5px;
border-bottom-right-radius:5px;
border-top-right-radius:5px;
-moz-box-shadow:0px 0px 3px #000 inset;
-webkit-box-shadow:0px 0px 3px #000 inset;
box-shadow:0px 0px 3px #000 inset;
}
span.reference{
position:absolute;
right:5px;
top:5px;
font-size:12px;
}
span.reference a{
color:#aaa;
text-decoration:none;
margin-left:10px;
}
span.reference a:hover{
color:#ddd;
}

/* position the fullscreen-button */
._video .media-controls-wrapper {
position: absolute;
bottom:0px;
width:100%
}
div.volume-slider {
right: 46px;
width: 60px;
}
.fullscreen {
right: 8px;
}
</style>
</head>
<body>
<div>
<h1 class="title">Multimedia Gallery</h1>
<span class="reference">
<a href="http://tympanus.net/codrops/2010/06/24/multimedia-gallery/"> Codrops</a>
<a href="http://www.flickr.com/photos/arcticpuppy/">Photos by tibchris</a>
</span>
</div>
<div id="mmg_media_wrapper" class="media_wrapper">
<ul></ul>
<div class="more" style="display:none">
<a id="mmg_more" href="#">Load More...</a>
</div>
</div>
<div id="mmg_overlay" class="overlay"></div>
<div id="mmg_preview" class="preview">
<div id="mmg_preview_loading" class="preview_loading"></div>
<div class="preview_wrap"></div>
<div id="mmg_nav" class="nav">
<a href="#" class="prev"></a>
<a href="#" class="next"></a>
</div>
</div>
<div id="mmg_description" class="description"></div>
<script type="text/javascript" src="json2.js"></script>
<script src="jquery.viewport.js" type="text/javascript"></script>
<script src="jquery.multimediagallery.js" type="text/javascript"></script>
</body>


----------

select-multiple-files-upload.php


<?php require_once "phpuploader/include_phpuploader.php" ?>
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PHP Upload - Selecting multiple files for upload</title>
<link href="demo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="demo">
<h2>Selecting multiple files for upload</h2>
<p> Select multiple files in the file browser dialog then upload them at once (Allowed file types: <span style="color:red">jpg, gif, png, zip</span>).
</ul>
<?php
$uploader=new PhpUploader();

$uploader->MultipleFilesUpload=true;
$uploader->InsertText="Upload Multiple File (Max 10M)";

$uploader->MaxSizeKB=1024000;
$uploader->AllowedFileExtensions="jpeg,jpg,gif,png,zip";

//Where'd the files go?
//$uploader->SaveDirectory="/myfolder";

$uploader->Render();
?>

<script type='text/javascript'>
function CuteWebUI_AjaxUploader_OnTaskComplete(task)
{
var div=document.createElement("DIV");
div.innerHTML=task.FileName + " is uploaded!";
document.body.appendChild(div);
}
</script>
</div>
</body>
</html>


i don't know what else you need to see whats going on, but i think that i explained it well enufe, if you need me to show more scripts let me know

thanks in advance for helping