hi i wan to add my .xml
files into database
and into the directory uploads
. i have following done into the php
if(isset( $_FILES["f_name"])
{
$path = "";
if(file_exists("uploads/" . $_FILES["f_name"]["name"]))
{
echo $_FILES["f_name"]["name"] . " already exists. ";
}
else if($_FILES["f_name"]["type"]!= "text/xml")
{
echo "invalid type is tried to upload.";
}
else
{
move_uploaded_file($_FILES["f_name"]["tmp_name"], "uploads/" . $_FILES["f_name"]["name"]);
$fileName = $_FILES["f_name"]["name"];
$path = "uploads/" . $_FILES["f_name"]["name"];
}
mysql_query("INSERT INTO mytable VALUES(NULL,'$path',) or die(mysql_error());
}
and here is my form in html
<form action="xyz.php" method="post" name="mar" enctype="multipart/form-data">
<input type="file" placeholder="Feed Upload*" required="required" name="f_name" class="inp-form file_1" />
<input type="submit" value="" name="submit" class="form-submit" />
</form>
now my question is that my query execute accurately but it doesn't insert the path of the file. now i want to store the path of the file which is in the current directory so that whenever i need the file i just single click on to the given path and the file will be executed??
is there any mean to store the path of the file and then execute that file? or i have to store a complete file into database??