Uploading a +1MB's file into a blob field

Discussion in 'PHP' started by +:::Spider25:::+, May 25, 2007.

  1. #1
    Hi Guys, I have a problem uplooading a file bigger than 1MB, It returns me the error 2006, why? I have reviewed all the config files and add the amount of bytes they allow but nothing.

    I'm using PHP5 and MySQL5

    I don't know if it is a MySQL error or a PHP error or even it could be an Apache error?

    Thanks for the answers, my file is attached
     

    Attached Files:

    +:::Spider25:::+, May 25, 2007 IP
  2. yedy72

    yedy72 Well-Known Member

    Messages:
    198
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #2
    yedy72, May 25, 2007 IP
  3. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Why are you storing a file this large in the database anyway? That just sounds like a problem waiting to happen and you should be storing the file on the server and the filename in the database instead.
     
    projectshifter, May 25, 2007 IP
  4. stugs

    stugs Peon

    Messages:
    157
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Look at your PHP settings first. I'm guessing your PHP execution time or max upload size are large enough for your upload. If you're on broadband start with the max upload size.

    I agree with projectshifter. Blobs are typically a bad idea for storing files for websites. That's not the truth for all applications, but you'll find most store uploaded files in a defined directory structure for a vast performance advantage.
     
    stugs, May 25, 2007 IP
  5. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Max execution doesn't matter on file uploading, and if he's getting a MySQL error it's definitely going in and you'd get a max_execution reached if that was the case, and the max_upload_size is 2mb by default, so a 1mb file should be fine.
     
    projectshifter, May 25, 2007 IP
  6. stugs

    stugs Peon

    Messages:
    157
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well..

    - Who said it was a mysql error?
    - he said BIGGER than 1MB. 2MB is bigger than 1MB so there's a good chance he's hitting his head on the PHP file upload size
    - If it takes him 5 minutes to upload a large file, that hits the max execution. I run into it all the time with file uploaders upping data files via slow ADSL or dialup.
     
    stugs, May 25, 2007 IP
  7. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    He said "It returns me the error 2006" error 2006 sounds like a MySQL error, PHP aren't numbered. You might be right on the 1MB thing, although people usually get that it's 2MB that it won't go above instead. If it takes 5 minutes to upload, if it's still in the sending request stage it wont' be PHP that times out, but apache (change your Timeout setting to something greater than 300 and you'll be fine). If it was PHP you'd get it to output a max execution reached, but if it's apache you'll get the unable to connect to the server, connection refused, or something similar to that.
     
    projectshifter, May 25, 2007 IP
  8. wing

    wing Active Member

    Messages:
    210
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    58
    #8
    wing, May 25, 2007 IP