php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26241 fopen fails to locate file
Submitted: 2003-11-13 11:14 UTC Modified: 2003-11-13 18:21 UTC
From: Brad dot Youngblood at 4S dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.3 OS: Windows NT
Private report: No CVE-ID: None
 [2003-11-13 11:14 UTC] Brad dot Youngblood at 4S dot com
Description:
------------
I am currently running an application that allows the user to browse for a file, attach it to an email, and send it out. This works fine while running on my local system off an Apache server. However when I run it off my companys webserver - Windows 2000 Server, IIS 5.0 - fopen can not find the file. The code is the same for both as is php.ini. The permission on the attached file are open. Any help would be greatly appreciated

Reproduce code:
---------------
        $fh = fopen($file, "rb");
        $data = fread($fh, filesize($file));
        $file_name = basename($file);


Expected result:
----------------
A successful open of the file

Actual result:
--------------
Warning: fopen(C:\\Projects\\test.doc): failed to open stream: No such file or directory

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-13 11:37 UTC] abies@php.net
Please double-check that the file you are trying to access 
is on a filesystem that is local to the webserver.  
 
It looks a bit like you're trying to do something 
silly ... 
 [2003-11-13 17:19 UTC] Brad dot Youngblood at 4S dot com
Resolved, turned out to be a configuration issue
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 17:01:36 2024 UTC