i have this problem regarding file upload on php. 
I always get this error msg.

> 
> Warning: file\_get\_contents(): Filename cannot be empty in
>  C:\xampp\htdocs\omf2\emprecords\add8.php on line 25
> 
> 
> 

this is my line 25

```
$data = $con->real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name']));

```

But still saves the info on my database.

What i am trying to do is save the rest of the records on my database even if not selecting a file to upload. And yes the records are saved and the Attachment field (mediumblob) is [BLOB - 0 B]

Question: How can i eliminate the error/warning message? (because everything is really fine) 

```
    <meta http-equiv="refresh" content="2;URL='emphistory.php'">
    <?php
    {
    echo "<center><font color='#AAA' size='3'><br/>Record Added!</center>";
    }
    ?>
    <?php
    $con=mysqli_connect("localhost","root","","dbomf");
    if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    $result = mysqli_query($con,"SELECT * FROM valueholder");   
    $row = mysqli_fetch_array($result);

    $count = '';
    $IDNUM = $row['Val'];
    $NS = addslashes($_POST ['NS']);
    $ad = addslashes($_POST ['ad']);
    $hr = addslashes($_POST ['HR']);
    $name = $con->real_escape_string($_FILES['uploaded_file']['name']);
    $data = $con->real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name']));

    include ('../dbconn.php');

    $query = "INSERT INTO tblemphist1 VALUES
    ('".$count."', '".$IDNUM."', '".$NS."', '".$ad."', '".$hr."', '".$data."', '".$name."')";

   $result = $db->query($query) or die($db->error);
   $db->close();

```

here 

```
 <form method="post" action="add8.php" enctype="multipart/form-data">
 <td><strong>Attachment</strong></td>
    <td>:</td>
    <td><input type="file" name="uploaded_file"></td>
    </tr>
 </form>

```