Sandip Posted March 11, 2007 Share Posted March 11, 2007 Hi, Background : I have a small question. In my website I have few imageboxes. I am asking user for image file and place it in image box. User will preview file and if he is happy he can upload(submit) the page. Now I am setting image as imagebox background using javascript as Image selection is just another pop up with browse button. After submitting the page I am reading file contents from its client location and insert it in to MYSQL. when I view binary contents using MySQL query browser I can see tht image but when I try to download it I cant see image.for downloading I read blob data then set headers and echo the contents. Question: My question is do I need to read file from its temp location on the server always? Can I just read file from client location and insert contents in to the database and then retrive it? I use strlen to get file size after reading it and image type from image name. Thanks a lot for your help ! Sandip Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 11, 2007 Share Posted March 11, 2007 1 min your doing all the images by blob data bit's correct if so dont stop there use the pic name in the database ok. Quote Link to comment Share on other sites More sharing options...
Sandip Posted March 11, 2007 Author Share Posted March 11, 2007 I did'nt get you redarrow.can you please explain a little ? Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 11, 2007 Share Posted March 11, 2007 your useing bineary in the database correct dont use the pic name. Quote Link to comment Share on other sites More sharing options...
Sandip Posted March 12, 2007 Author Share Posted March 12, 2007 hi i solved the problem. problem was i was sending some data to browser like echo tht was upseting the headers. I removed all echo but one. n it worked. thanks for your prompt help though. Sandip Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.