Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Maryland, USA
    Posts
    165
    Thanks
    12
    Thanked 0 Times in 0 Posts

    filesize() error

    Hi,

    I'm trying to run a filesize() function so that I can insert the result into the length field of an xml enclosure tag. But...the is returning an error like this for each enclosure:

    Code:
    <b>Warning</b>
    :  filesize() [
    <a href="function.filesize">function.filesize</a>
    ]: stat failed for http://www.maggiepascal.com/show_audio/maggie_022408b.mp3 in 
    <b>/home/maggiepa/public_html/podcast1.php</b>
     on line 
    <b>56</b>
    I've tried using the absolute url and also $_SERVER['DOCUMENT_ROOT'].$filename, but it doesn't seem to be able to find the file info.
    The permissions for the file and folder are set to 777.

    Does anyone know why this would happen?

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    You should always use the file path "/home/maggiepa/public_html/show_audio/maggie_022408b.mp3" if you're on the same server as the file, because URL wrappers can fail easily, and take much longer to execute.

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by madmatter23 View Post
    Hi,

    I'm trying to run a filesize() function so that I can insert the result into the length field of an xml enclosure tag. But...the is returning an error like this for each enclosure:

    Code:
    <b>Warning</b>
    :  filesize() [
    <a href="function.filesize">function.filesize</a>
    ]: stat failed for http://www.maggiepascal.com/show_audio/maggie_022408b.mp3 in 
    <b>/home/maggiepa/public_html/podcast1.php</b>
     on line 
    <b>56</b>
    I've tried using the absolute url and also $_SERVER['DOCUMENT_ROOT'].$filename, but it doesn't seem to be able to find the file info.
    The permissions for the file and folder are set to 777.

    Does anyone know why this would happen?
    I don't think the problem is permission, maybe:
    - path of the file, check the parameter of filesize
    - wrappers, as Inigoesdr said, probably you can't access the file in url form, and of course using direct path is allways faster

    best regards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •