php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #16426 $HTTP_POST_FILES['userfile']['tmp_name'] returns "n"
Submitted: 2002-04-04 06:01 UTC Modified: 2003-01-02 19:49 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: dom at brainwaveuk dot com Assigned: hholzgra (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.1.2 OS: Sun raq4, RedHat
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dom at brainwaveuk dot com
New email:
PHP Version: OS:

 

 [2002-04-04 06:01 UTC] dom at brainwaveuk dot com
I have had a file upload script working in 4.0.5, but I just upgraded to 4.1.2 and have been getting problems with the $HTTP_POST_FILES['userfile']['tmp_name'] variable.

It seems that it always returns 'n' as the temporary filename.  I have tried replacing $HTTP_POST_FILES with the new $_FILES variable, but I still get the same problem.

It would be great if you can help!!

Thanks guys

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-04 06:05 UTC] hholzgra@php.net
$HTTP_POST_FILES['userfile'] is "none" when 
an upload fails (eg. due to size restrictions)

so you should check for 

  is_array($HTTP_POST_FILES['userfile']) 

first

changed to "Documentation problem"


 [2002-04-04 06:12 UTC] dom at brainwaveuk dot com
Hmm the thing is I can get the information from all of the other parts of the array, the original filename and file type all come out correct, but the temp name is still 'n'...
 [2002-04-04 06:53 UTC] dom at brainwaveuk dot com
I have had a file upload script working in 4.0.5, but I just upgraded to
4.1.2 and have been getting problems with the
$HTTP_POST_FILES['userfile']['tmp_name'] variable.

It seems that it always returns 'n' as the temporary filename.  I have
tried replacing $HTTP_POST_FILES with the new $_FILES variable, but I
still get the same problem.

It would be great if you can help!!

Thanks guys
 [2002-04-04 07:13 UTC] sniper@php.net
In PHP 4.2.0 (and above) there will be also an 'error'
entry in the array which has some more info:

/* Errors */
#define UPLOAD_ERROR_A  1  /* Uploaded file exceeded upload_max_filesize */
#define UPLOAD_ERROR_B  2  /* Uploaded file exceeded MAX_FILE_SIZE */
#define UPLOAD_ERROR_C  3  /* Only partiallly uploaded */
#define UPLOAD_ERROR_D  4  /* No file uploaded */
#define UPLOAD_ERROR_E  5  /* Uploaded file size 0 bytes */

It's 0 if the upload was succesful.

 [2002-05-15 21:25 UTC] sniper@php.net
And this is still docu prob.

 [2002-08-05 17:17 UTC] jaguinaga at yahoo dot com
For somethings version of RedHat Linux, you need modify the php.ini (/etc/php.ini), search a line:

file_uploads=Off

modify to:

file_uploads=On

And everything is Ok.

See you.

Juan Alberto Aguinaga Rodriguez.
 [2003-01-02 19:49 UTC] nicos@php.net
Documentation is now clear on that too. 

Link: http://www.php.net/manual/en/features.file-upload.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 12:01:32 2024 UTC