So I'm using this script to upload a .htm file, the only problem is after I upload the file the extension is gone and doesn't display as a web page. If I go into the folder and rename the file to vsquarel.htm the file displays as a web page again. So my question is how do I upload a .htm file and keep the file type?
Here's the code:
<?php
$file_name = $HTTP_POST_FILES['ufile']['name'];
$new_file_name=vsquarel;
$path= "vsql/".$new_file_name;
if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Successful<BR/>";
echo "File Name :".$new_file_name."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
}
else
{
echo "Error";
}
}
?>