Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 593665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:52:12+00:00 2026-05-13T15:52:12+00:00

I’m writing a PHP page that generates a podcast feed by scraping an existing

  • 0

I’m writing a PHP page that generates a podcast feed by scraping an existing HTML page. Everything works great, but one of my mp3 files gives a “filesize(): stat failed” error. As best as I can tell, the file isn’t corrupted, and it plays perfectly fine. I’ve also reuploaded the file to the server. It falls in the middle range of all the file sizes, so I don’t think the file is too large. Because every other file returns a file size, I’m assuming the problem is with the mp3 file, not with my server configuration. Is there something else I should be checking?

Here’s the relevant part of my code:

$i = 1; //skipping header row on table
do {
    $tr = $table->find('tr', $i);

    $date = $tr->find('div', 0)->plaintext;
    $datetime = new DateTime($date);
    $speaker = $tr->find('div', 1)->plaintext;
    $title = $tr->find('div', 2)->plaintext;
    $url = $tr->find('div', 3)->find('a', 0)->href;
    $fullurl = "http://domain.org/resources/".$url;
    $filesize = filesize($url); //<---works on every file except one

    echo "<item><title>".$title."</title>\n";
    echo "<description>".$title." - ".$datetime->format('D, M jS, Y')." - ".$speaker."</description>\n";
    echo "<itunes:author>".$speaker."</itunes:author>\n";
    echo "<enclosure url=\"".$fullurl."\" length=\"".$filesize."\" type=\"audio/mpeg\"/>\n";
    echo "<guid isPermaLink=\"true\">".$fullurl."</guid>\n";
    echo "<pubDate>".$datetime->format('r')."</pubDate>\n";
    echo "<itunes:explicit>clean</itunes:explicit></item>\n\n";

    $i++;
}while ($table->find('tr', $i) != NULL);

As requested: (do people point out edits? This is my first question here..)

The filename is “12-20-09_AM_Podcast.mp3” which follows the naming convention of every other file, and all the files have permissions of 644. The full error code is

<b>Warning</b>:  filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for audio/12-20-09_AM_Podcast.mp3 in <b>/homepages/1/d106955786/htdocs/victory/resources/podcast1.php</b> on line <b>45</b><br />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:52:13+00:00Added an answer on May 13, 2026 at 3:52 pm

    For some reason the web-server on domain.org isn’t returning a Content-Length header field, which is causing filesize() to fail.

    If the file is stored locally, filesize() the local copy of the file instead. If not, you cannot fix this issue as it is a problem on domain.org‘s web-server. You could work around the issue by downloading the file locally and checking filesize() then, but this will slow down your page majorly.

    If the file is stored locally, check your file name or your anchor again. You might have misspelled one (or both) and Apache mod_speling is fixing it for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.