SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Binary image uploads ?

    Hi,

    I have a small database running and I would like to add a "upload images" sections.
    What does the database setting need to be on to hold the binary images and is it the same process as text input?

    Any examples would be great.

    Thanks.

  2. #2
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont know if mySQL can hold binary images in its database... I think the only way to do uploads is to store the binary file (or any file being uploaded) in a specific directory on your server, then insert that location into your database..

    Am I correct here?

    You might want to check out this script.. fileupload.class
    Marc Gugliuzza
    marc.gugliuzza.com



  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can most certianly store binary data in a mysql database. Although it is incredibly resource intensive to read images from a database. You are better off to do as mentioned and store the file in a directory, you could store the filename and location in the db however.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    This is all Mumbo Jumbo Amit's Avatar
    Join Date
    Oct 2001
    Location
    New Delhi, India
    Posts
    277
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can certainly store binary images, just set the type of the field as
    Code:
    BLOB
    .

    But if you want this on a site, where performance is an issue, it is strongly NOT recommended because it could have a 30% performance hit.*

    If you want to tie up an image with a record you can upload them in a directory with filenames as the records Primary key.

    Check out http://www.pustakmahal.com/book/books.phtml?cid=map for an idea ...

    * As mentioned on one of the articles on Zend.com
    Last edited by Amit; Oct 15, 2001 at 13:11.

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right or you can simply repeat what someone just posted 5 hours earlier.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •