Storing word Document file to mysql database

Okay, you said:

############ #METHOD A # // this is what you asked me to do on your last post ############

$sql = “SELECT filename, filetype, filesize, filedata FROM files WHERE ID=$id”;
$result = @mysql_query($sql);
$data = @mysql_result($result, 0, “filedata”);

header("Content-type: image/jpeg"); 
echo $filedata;</blockquote>

Well, actually, I didn’t say that or at least didn’t mean it. If you load the database’s blob data into a variable called $data, you would echo that data not the field name… If I told you that, I am sorry. So, it should be something like this:
[php]
$sql = “SELECT filename, filetype, filesize, filedata FROM files WHERE ID=$id”;
$result = @mysql_query($sql);
$data = @mysql_result($result, 0, “filedata”);

header("Content-type: image/jpeg"); 
echo $data;     //*** Note: this was the line in error...

[/php]
Let us know if it does not work… Sorry it took so long to reply, still helping my sick mother…

i tested the script but unfurtunately using that method all i get is broken image link something like this -->

i updated the zip with your code so you can redownload it and maybe test it on your localhost you might be able to solve it faster.

im sorry about yuor mother is sick i hope she gets better.

What do you mean by “broken image link”??? Do you mean it shows an image block on the page?
I will try it on my server in the morning, bed is calling right now…

Oh, have you tried to store the $data into a file and compare it to the one you uploaded?

Well, more in the morning…

well tomorrow maybe we could work on it together. i will pm you my skype name so that you can add me and we can work on it by teamviewer

Sponsor our Newsletter | Privacy Policy | Terms of Service