[jQuery] Rename a file name

[jQuery] Rename a file name

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18783"></HEAD>
<BODY>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN class=519093823-20072009>I was
wondering if someone could point out how to rename a file
name.</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN
class=519093823-20072009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN class=519093823-20072009>In the
script I am using I see</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN
class=519093823-20072009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN class=519093823-20072009>function
fileFromPath(file){  <BR>  return file.replace(/.*(\/|\\)/,
"");<BR>}</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN
class=519093823-20072009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN class=519093823-20072009>which
replaces characters.... but how would I completely rename the
file</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN
class=519093823-20072009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN class=519093823-20072009>I
tried:</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN
class=519093823-20072009></SPAN></FONT> </DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN class=519093823-20072009>function
fileFromPath(file){<BR> <BR>     var dateObject = new
Date();<BR>     var file
=<BR>         
dateObject.getFullYear() + ''
+<BR>         
dateObject.getMonth() + '' +<BR>        
dateObject.getDate() + ''
+<BR>         
dateObject.getTime();<BR><BR>     return file("");<BR> 
<BR>  //return file.replace(/.*(\/|\\)/, "");<BR>  <BR>} but i
lose the extension of the file</SPAN></FONT></DIV>
<DIV><FONT size=2 face="Trebuchet MS"><SPAN
class=519093823-20072009></SPAN></FONT> </DIV>
<DIV align=left><FONT size=2 face=Arial>Dave </FONT></DIV></BODY></HTML>