help in PHP-mysql

Status
Not open for further replies.

bukaida

In the zone
I want to insert an image as long blob in mysql4.0. I am using php 4.4 with apache 2 under winXP.
The following script I am using for inserting the image which is not working.
I have changed the buffer and global settings(output_buffering = on and register_globals = on) in php.ini file but with no result. Kindly see the attachment and please help.
 

mediator

Technomancer
*hockinson.com/index.php?s=37

But I wud recommend to store them in server folders n use em from there!
 
OP
bukaida

bukaida

In the zone
I found a good solution with working script(Yes working script) which I want to share with you guys.please see the attachment or click
*www.dreamwerx.net/phpforum/?id=1


Thanx Mediator, indeed I was also thinking about the same as it is said that unless you are having a good pattern recognition software which can identify a rose from a picture of garden, storing image in database is not a very good idea. Another problem is the size restriction. I want to store a scanned image (in tiff format) which has approximately 35 to 40MB size. This is very very difficult if i use the database.So your solution will be very helpful. can you provide me a script or a link? Thanx in advance.
 

mediator

Technomancer
@bukaida : See u can store the image in a folder and develop a php script so that u can manually enter the filepath of that file and make it as a link!

To make an existing file as a link (so that u can open it via link) here's the script!

<?php
$filename="path/xyz.jpg";
if (file_exists($filename)) echo "<a href=\"$filename\">$filename</a>";
?>

Here instead of "path/xyz.jpg" u can retrieve the filepath from some Form where u can enter the filepath more conveniently! Then instead of "path/xyz.jpg" it wud be $_POST["file"] where file is a variable of the form!

U can use this idea to insert the filepath in mysql and retrieve it from there and make it a link !!
 
OP
bukaida

bukaida

In the zone
@mediator: Got your idea but can it be used to upload the image file. I mean the image is in client's machine and it should be uploaded to a remote folder at the server so that another client can download and use it.Can you help?
 

mediator

Technomancer
@bukaida : Sorry dood, I haven't yet tried the remote upload part of php yet! U can manually ftp to upload the file or follow this link! See the php ftp n http section on left hand side!
 

kalpik

In Pursuit of "Happyness"
Code:
if ($_FILES['imagefile']['type'] == "image/jpg"){ 
   copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name']) 
    or die ("Could not copy");

This is something i made a long time back. See if it works for you, the code is self explanatory.
 
Status
Not open for further replies.
Top Bottom