SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2001
    Location
    Canada
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mySQL and/or PHP Binary Limitation

    Hi there

    I want to store PDF file in a mysql db
    everything is fine after I changed:
    - the upload_max_file in php.ini to the my desired
    size of 25Megs
    - safe_mysqld daemon now has the following switches
    -O key_buffer=16M
    -O table_cache = 128
    -O sort_buffer=4M
    -O record_buffer = 1M
    -O max_allowd_packet=12M

    I able to upload ( insert in the db ) say a PDF
    less then 25Megs, but when I try to retrieve
    it only outputs 65K....

    I believe my code is okay because if I try with
    a file say 100K it works find both ways insert
    and select.

    I'm thinking there is something that needs to
    configured???

    Thank you in Advance

  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'd advise agains't storing the file itself in the db.
    instead, store it on your webserver and insert the file's location in the db.
    this will help if your site gets popular, as imagine 100 concurrent requests for a 25mg file.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


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
  •