Re: different servers, different results with a file upload [message #175208 is a reply to message #175207] |
Tue, 23 August 2011 11:45 |
bill
Messages: 310 Registered: October 2010
Karma:
|
Senior Member |
|
|
On 8/22/2011 10:13 AM, Twayne wrote:
> In news:Lv2dnVLhHazLs8zTnZ2dnUVZ_sednZ2d(at)cablespeedmi(dot)com,
> bill<nobody(at)spamcop(dot)net> typed:
>> I have a small script that works fine on the development
>> server, but when I try to run it for real on the
>> production server it does not work.
>>
>> here is the html:
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>> "http://www.w3.org/TR/html4/strict.dtd">
>>
>> <html>
>> <head>
>> <title>CaseNoteCheck</title>
>> </head>
>> <body>
>>
>> <h2>Case Note Edit Checker</h2>
>> <form action="caseNoteChecker.php" method="POST"
>> enctype="multipart/form-data">
>> <input type="hidden" name="MAX_FILE_SIZE" value="40000" />
>> <input type="file" name="caseNote"/>
>> <input type="submit"/>
>> </form>
>>
>> </body>
>> </html>
>>
>> here is the top of the php script:
>> <?php
>> //caseNoteChecker.php receives file from
>> CaseNoteChecker.html
>> session_start ();
>> error_reporting(E_ALL);
>>
>> $_SESSION ['current_user'] = "WPD";
>>
>>
>> echo "<pre>";
>> print_r($_POST);
>> print_r($_FILES);
>> echo "</pre>";
>>
>> On the development server the file uploads correctly and
>> all is well. On the production server the $_FILE array is
>> empty.
>> Array
>> (
>> [caseNote] => WPD-CaseNotes.txt
>> )
>> Array
>> (
>> )
>>
>> and naturally it fails.
>>
>> I searched with google and found a terrific article by
>> jkorpela, but afak I am doing it right.
>>
>> Suggestions to debug this please. It must be a server
>> configuration issue but I don't know where to look.
>>
>> bill
>
> Are the server PHP versions the same? Deprecated or "improved" features can
> cause a lot of problems.
>
>
>
Yes they are. Still no clue why "identical" servers would behave
differently, but cleaning up the html (thanks Jerry) fixed that
problem.
bill
|
|
|