php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50422 error uploading file
Submitted: 2009-12-09 05:51 UTC Modified: 2009-12-09 08:19 UTC
From: syed dot msn at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.1 OS: windows vista
Private report: No CVE-ID: None
 [2009-12-09 05:51 UTC] syed dot msn at gmail dot com
Description:
------------
$pic = $_FILES["pic_field"]["name"];
copy($HTTP_POST_FILES["pic_field"]["temp_name"],"")

error ---> "$HTTP_POST_FILES" is undefined, picture name can not be 
empty



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-09 08:18 UTC] jani@php.net
You have quite likely not enabled "register_long_arrays" directive. Just use $_FILES always. And preferrably http://php.net/move_uploaded_file instead of copy()..
 [2009-12-09 08:19 UTC] jani@php.net
Oh, and it's not "temp_name" it's "tmp_name" :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 04 02:00:02 2025 UTC