php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3452 file upload feature broken under Windows web browsers
Submitted: 2000-02-11 00:23 UTC Modified: 2002-09-30 20:19 UTC
From: jfbell at inetz dot com Assigned:
Status: Not a bug Package: Other
PHP Version: 3.0.14 OS: FreeBSD 3.4
Private report: No CVE-ID: None
 [2000-02-11 00:23 UTC] jfbell at inetz dot com
The following code appears to work when a web browser is started under a UNIX environment, however the same code produces an error when I start a web browser under a Windows machine.

      $image_base="aaa";

      if (eregi("\.(jpg|gif)$",$image1,$regs)) {
	  copy($image1,"../homes/images/".$image_base.".".$regs[1]);
      }

The error that appears under a windows browser looks like this:

Warning: Unable to open 'C:\Documents and Settings\jfbell\My Documents\My Pictures\Sample.jpg' for reading: No such file or directory in /shared/www/data/old/virtual/i/ivoryhomes/control/modelhomes.phtml on line 18

Obviously, php is trying to use the Windows filename when copying.  This is wrong.

Can anyone help with this?
-John

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-30 20:19 UTC] hholzgra@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.

thats how windows browsers treat file uploads
you can always use basename() to extract just
the filename
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC