Jump to content

fopen says "Unable to access" yet file exists!


MaxG

Recommended Posts

I run a dev site locally on Windows and the real site on a hosting provider on LINUX. PHP5, XAMP, etc.

 

Locally my fopen works.

On the web server it throws an error: "Warning: fopen() [function.fopen]: Unable to access" filepath/name

 

The file exists on both servers; upper/lower case is correct; so are access rights.

 

I noticed the error only today; this was working for the last 7 months; the function serves a range of content-types; just tested XLS and it works.

 

Now I am stuck  :confused:

 

This line throws the error:

$handle = fopen($strPathFileName, 'rb');

 

$strPathFileName uses / only

 

Any pointers appreciated... thanks.

thanks!

I get FALSE

 

I have compared paths:

Unable to access /var/www/vhosts/domain.net/subdomains/www.name/httpdocs/resources/Music/MIDIs/Hermann/Hermann13.zip

 

... and actually echoing the $strPathFileName -- and they match.

 

What puzzles me is that XLS, PDF and MP3 files are served nicely by my code. Not so ZIP; yet the content-type = application/zip

 

I have just uploaded the table with the file details; just in case they are corrupt -- same problem.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.