It is displaying the type as Ms word in dialog box but if we click to open it then it first to convert the file to and displays several options and after clicking on any option it displays page could not be found. The page doesnt gets openedon clicking open.
Sorry, didn't get this...
The user can even upload the file as .txt so what should be done for that.
For that, you got to check the type of the file before sending the corresponding header.
When you save the uploaded file, check for its type and add the type to another column (say
file_type) in the db table.
(* One of the indices of $_FILE contains file type.)
And modify your code like this...
[php]<?php
if (!isset($_GET['id'])) die('Invalid Parameter');
require "./include/config.php";
$id = $_GET['id'];
$result= "SELECT Content, file_type FROM userdetails WHERE ResumeFile = '$id'";
$data = mysql_query($result) or die(mysql_error());
$info = mysql_fetch_array($data);
header('Content-disposition: attachment; filename="'.$id.'"');
if ($info['file_type']=="text") //make sure if its text or text/plain
header('Content-type: text/plain');
else if($info['file_type']=="msword") //verify msword too
header('Content-type: application/msword');
readfile($info['Content']);
?>[/php]