Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2934

Re: different servers, different results with a file upload

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: different servers, different results with a file upload
Date 2011-08-21 16:06 -0400
Organization A noiseless patient Spider
Message-ID <j2rogp$pjj$1@dont-email.me> (permalink)
References <Lv2dnVLhHazLs8zTnZ2dnUVZ_sednZ2d@cablespeedmi.com>

Show all headers | View raw


On 8/21/2011 12:11 PM, bill wrote:
> 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

Sorry - sent before I meant to

If all these fail, the next thing to check would be differences in PHP 
version on the two systems.  I haven't seen any problem with $_POST in 
PHP, but that doesn't mean it doesn't exist.

The other thing you might want to do is add display_errors=on to your 
script.  But your problem here is the $_POST initialization is long 
before you get to any code in your script, so if there is an error in 
setting up $_POST, you'll never see it.  In such cases it's better to 
place the values in your httpd.conf file (if you're using Apache).  See 
http://www.php.net/manual/en/configuration.changes.php for more 
information on how to do this.

NOW I think I'm done :)
-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

different servers, different results with a file upload bill <nobody@spamcop.net> - 2011-08-21 12:11 -0400
  Re: different servers, different results with a file upload bill <nobody@spamcop.net> - 2011-08-21 12:18 -0400
  Re: different servers, different results with a file upload bill <nobody@spamcop.net> - 2011-08-21 12:24 -0400
  Re: different servers, different results with a file upload Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-21 15:52 -0400
    Re: different servers, different results with a file upload bill <nobody@spamcop.net> - 2011-08-21 17:18 -0400
      Re: different servers, different results with a file upload Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-21 18:10 -0400
      Re: different servers, different results with a file upload Gregor Kofler <usenet@gregorkofler.com> - 2011-08-22 10:32 +0200
  Re: different servers, different results with a file upload Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-21 16:06 -0400
  Re: different servers, different results with a file upload "Twayne" <nobody@devnull.spamcop.net> - 2011-08-22 10:13 -0400
    Re: different servers, different results with a file upload bill <nobody@spamcop.net> - 2011-08-23 07:45 -0400

csiph-web