help in PHP-mysql

Discussion in 'Open Source' started by bukaida, Nov 1, 2006.

Thread Status:
Not open for further replies.
  1. bukaida

    bukaida New Member

    Joined:
    Jul 21, 2005
    Messages:
    326
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    KOLKATA
    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.
     
  2. OP
    OP
    bukaida

    bukaida New Member

    Joined:
    Jul 21, 2005
    Messages:
    326
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    KOLKATA
    A bump for all??
     
  3. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
  4. OP
    OP
    bukaida

    bukaida New Member

    Joined:
    Jul 21, 2005
    Messages:
    326
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    KOLKATA
    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
    http://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.
     
  5. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
    @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!

    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 !!
     
  6. OP
    OP
    bukaida

    bukaida New Member

    Joined:
    Jul 21, 2005
    Messages:
    326
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    KOLKATA
    @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?
     
  7. mediator

    mediator New Member

    Joined:
    Mar 18, 2005
    Messages:
    2,491
    Likes Received:
    16
    Trophy Points:
    0
    Location:
    In ur Evil Mind!
    @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!
     
  8. kalpik

    kalpik In Pursuit of "Happyness"

    Joined:
    May 18, 2005
    Messages:
    3,002
    Likes Received:
    15
    Trophy Points:
    0
    Location:
    New Delhi
    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.
     
Thread Status:
Not open for further replies.

Share This Page