php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15381 $_FILES["X"]["name"] strips local path from the users entered name
Submitted: 2002-02-05 04:56 UTC Modified: 2002-02-05 10:53 UTC
From: bob dot pardoe at hayslogistics dot co dot uk Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.1.0 OS: W2K Pro
Private report: No CVE-ID: None
 [2002-02-05 04:56 UTC] bob dot pardoe at hayslogistics dot co dot uk
I am trying to write a form to upload files to the server.

Running 4.1.0 on W2K Pro, IIS , and php.recommended.ini 

The first form gets the local (client) file name i.e. c:\dir1\dir2\file1.txt this is displayed to the user in the <input type = file name = filename ... > text box.

The php script that the form posts to uses $_FILES["filename"]["name"]. This returns : file1.txt 

The local path to the file has been lost.

I have not seen any documentation that implies that this is intentional or that there is another element in the array that has the whole C:\... file name.

As a consequence the file copy fails as the php script cannot find the file.

Thanks

BOb

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-05 10:53 UTC] sander@php.net
Not a bug in PHP.

The browser only sends the filename, and no path information. I guess that's normal HTTP/1.x behaviour.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 18:01:28 2024 UTC