php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16510 fopen to a URL containing spaces fails
Submitted: 2002-04-09 06:13 UTC Modified: 2002-07-12 04:08 UTC
From: davidviner at puggle dot freeserve dot co dot uk Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.1.1 OS: Windows NT
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: davidviner at puggle dot freeserve dot co dot uk
New email:
PHP Version: OS:

 

 [2002-04-09 06:13 UTC] davidviner at puggle dot freeserve dot co dot uk
Using fopen to access a remote file will fail if the URL path contains spaces.

A server contains the following files:

/Test Dir/default.asp
/TestDir/default.asp

The following fopen will succeed:

$f = fopen ("http://server/TestDir/default.asp", "r");

while this one will fail:

$f = fopen ("http://server/Test Dir/default.asp", "r");

I have tried replacing them with "%20" and escaping the spaces "\ " but neither succeed.

The above fails on both IIS and PWS.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-09 07:22 UTC] wez@php.net
Can you verify if this is still true for PHP 4.2RC2?
get it from: http://www.php.net/~derick
If it still has problems, are you in a position to
sniff the network packets to see what it going on?
 [2002-04-09 10:26 UTC] davidviner at puggle dot freeserve dot co dot uk
The same problem occurs on 4.2RC2. However, I do not have access to (or am allowed to use) any network sniffers.
 [2002-07-10 23:45 UTC] sniper@php.net
I test this with PHP 4.3.0-dev (CVS) and using %20 works.
Please try this snapshot:

http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-07-12 04:08 UTC] davidviner at puggle dot freeserve dot co dot uk
Yes, it now works fine. Thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Aug 24 17:00:03 2025 UTC