Hello all,
First off thanks for reading this...
The following code works fine on my redhat linux box at home, however
it does not work when running on my webhost, whose server is also
apache.
I realize that they have some aspects of the server disabled for
security, but
after looking at my code, their representative said it should work
fine.
The idea of the code is to upload images from the client, store them
as strings in the mysql db then return them upon request.
As I mentioned, this works fine at home (with no restrictions from my
apache)
but will not work on my hosts server.
The images render fine at home, but they do not display when running
from hostica host.
What could I be overlooking?
thanks, the code is below...[color=blue][color=green][color=darkred]
> >> =============== =============== =============== ==
> >> Here is the storing logic:
> >> ($eflag is the picture data)
> >>
> >> $ffile = fopen($_FILES['form_data']['tmp_name'],"rb");
> >> $contents = fread($ffile,$_ FILES['form_data']['size']);
> >> $eflag = mysql_escape_st ring($contents) ;
> >> $sql = "INSERT INTO items(itemId, itemName, itemDesc, itemPrice,
> >> item_key_words, photo_data)" ."VALUES
> >> ('','$name','$f orm_description ','$price','$ke ywords','$eflag ') ";
> >> =============== =============== =============== ==
> >> Here is the retrieval logic:
> >>
> >> header("Content-type: image/jpg");
> >>
> >> $sql = "SELECT photo_data FROM items WHERE itemId ='$dns'";
> >>
> >>
> >> $result = mysql_query($sq l);
> >> $nrows = mysql_num_rows( $result);
> >>
> >> if($nrows == 1) {
> >> $row = mysql_fetch_arr ay($result);
> >> echo $row['photo_data'];
> >> }
> >> =============== =============== =============== ==[/color][/color][/color]
First off thanks for reading this...
The following code works fine on my redhat linux box at home, however
it does not work when running on my webhost, whose server is also
apache.
I realize that they have some aspects of the server disabled for
security, but
after looking at my code, their representative said it should work
fine.
The idea of the code is to upload images from the client, store them
as strings in the mysql db then return them upon request.
As I mentioned, this works fine at home (with no restrictions from my
apache)
but will not work on my hosts server.
The images render fine at home, but they do not display when running
from hostica host.
What could I be overlooking?
thanks, the code is below...[color=blue][color=green][color=darkred]
> >> =============== =============== =============== ==
> >> Here is the storing logic:
> >> ($eflag is the picture data)
> >>
> >> $ffile = fopen($_FILES['form_data']['tmp_name'],"rb");
> >> $contents = fread($ffile,$_ FILES['form_data']['size']);
> >> $eflag = mysql_escape_st ring($contents) ;
> >> $sql = "INSERT INTO items(itemId, itemName, itemDesc, itemPrice,
> >> item_key_words, photo_data)" ."VALUES
> >> ('','$name','$f orm_description ','$price','$ke ywords','$eflag ') ";
> >> =============== =============== =============== ==
> >> Here is the retrieval logic:
> >>
> >> header("Content-type: image/jpg");
> >>
> >> $sql = "SELECT photo_data FROM items WHERE itemId ='$dns'";
> >>
> >>
> >> $result = mysql_query($sq l);
> >> $nrows = mysql_num_rows( $result);
> >>
> >> if($nrows == 1) {
> >> $row = mysql_fetch_arr ay($result);
> >> echo $row['photo_data'];
> >> }
> >> =============== =============== =============== ==[/color][/color][/color]
Comment