HTTP File Uploads with PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Thebert
    Member
    • Mar 2001
    • 71
    • 5.5.x

    HTTP File Uploads with PHP

    I'm new to PHP, and I have two different PHP scripts (vBulletin 2b2 and one other) that both use HTTP-protocol file uploading.

    Both are failing, and I think I've discovered why. I'm just not sure what to *do* about it.

    A JPG image file that displays fine locally GROWS by 29 bytes when it is uploaded. These bytes are appended on the front of the image file, and appear to be an HTML header. When I delete these aditional bytes with a hex-editor, the file is corrected and will once again display properly.

    The errant 29 bytes are:

    Hex - ASCII

    43 - C
    6F - o
    6E - n
    74 - t
    65 - e
    6E - n
    74 - t
    2D - -
    54 - T
    79 - y
    70 - p
    65 - e
    3A - :
    20 - <SPACE>
    69 - i
    6D - m
    61 - a
    67 - g
    65 - e
    2F - /
    70 - p
    6A - j
    70 - p
    65 - e
    67 - g
    0D <CR>
    0A <LF>
    0D <CR>
    0A <LF>

    I saw nothing in "php.ini" specifically referencing "append header to HTTP uploads" or anything.

    I'm using Apache 1.3.14 with mod_php, and PHP 4.0.4

    Can anyone suggest where I might look and/or what I might do to prevent these additional bytes from being appended? I believe it will fix BOTH vBulletin 2b2 and the other script I'm trying to run.

    Regards,

    Bill
    Boulder, CO
  • Mike Sullivan
    Former vBulletin Developer
    • Apr 2000
    • 13327
    • 3.6.x

    #2
    Check these out:

    Comment

    • Bill Thebert
      Member
      • Mar 2001
      • 71
      • 5.5.x

      #3
      Your tips were right on the money.

      *Precisely* the problem I was experiencing.

      I downloaded:



      and



      and now HTTP-upload is working perfectly in BOTH of my test scripts.

      You oughta consider doing this for a living, Ed <g>

      (or is it "Mike"?)

      Regards,

      Bill

      Comment

      • Mike Sullivan
        Former vBulletin Developer
        • Apr 2000
        • 13327
        • 3.6.x

        #4
        Originally posted by Bill Thebert

        You oughta consider doing this for a living, Ed <g>

        (or is it "Mike"?)
        You could call me Al for all I care

        Glad to see it's fixed.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...