|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28802 name of file upload cutted in php4.3.7
Submitted: 2004-06-16 11:52 UTC Modified: 2004-07-04 19:09 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mstaiger at informatik dot uni-siegen dot de Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.3.7 OS: win 2k server
Private report: No CVE-ID: None
 [2004-06-16 11:52 UTC] mstaiger at informatik dot uni-siegen dot de
The typical file-upload HTML-command:

<input type="file" size=50 name="userfile">

creates an input field to pick a file from the local machine.

We used to "abuse" this field also to insert URLs instead of physical filenames which worked fine so far. When entered "" the php variable $_FILES['userfile']['name'] contained the entire URL : ""

Now, the new version seems to cut everything before the last slash and $_FILES['userfile']['name'] contains only "", without "http://" .

We could not find any documentation for this behaviour and doubt that this behaviour was desired?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-18 20:02 UTC] imprestavel at gameguru dot com dot br
You may try:
<input type="text" size=50 name="userURL">

Using input-file for URL was not desired because input-file is for uploading local files.

From the manual:

    The *original name* of the *file on the client machine*."

original name != url/path

And if the client/browser decides to upload a "fake" empty file, because it doesn't exist locally, there is nothing php can do about it, but you could check that and do something
 [2004-07-04 19:09 UTC]
The original path is just the filename, not the path + 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 09:03:43 2023 UTC