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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.