ID: 49921 Updated by: j...@php.net Reported By: jon at feburman dot co dot uk -Status: Open +Status: Feedback Bug Type: cURL related Operating System: Redhat 5 PHP Version: 5.2.11 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2009-10-19 13:50:47] jon at feburman dot co dot uk Description: ------------ Files being uploaded via http post come across with a url encoded version of the whole file path rather than just the name part as it did in older versions of PHP. Reproduce code: --------------- function upload($dir, $file, $userpass) { if( ! $this->cURLcheckBasicFunctions() ) return false; $ch = curl_init(); if($ch) { $data = array('dir' => $dir, 'filedata0' => "@$file"); if( !curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ) return false; if( !curl_setopt($ch, CURLOPT_URL, $this->url)) return false; if( !curl_setopt($ch, CURLOPT_USERPWD, $userpass)) return false; if( !curl_setopt($ch, CURLOPT_POST, 1)) return false; if( !curl_setopt($ch, CURLOPT_POSTFIELDS, $data)) return false; if( !curl_exec($ch) ) return false; curl_close($ch); return true; } else return false; } Expected result: ---------------- File arrives on remote server called "SAV2906_A4L_4pp_D_shipping_label.pdf" Actual result: -------------- File arrives on remote server called ":2Fvar:2Fwww:2Fvhosts:2Ffeburman.co.uk:2Fhttpdocs:2Fsprint:2Fjobs:2Fjob 2906:2FSAV2906_A4L_4pp_D_shipping_label.pdf" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49921&edit=1