...

View Full Version : filesize() error



madmatter23
03-09-2008, 06:12 PM
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:



<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?

Inigoesdr
03-09-2008, 06:20 PM
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.

oesxyl
03-09-2008, 06:31 PM
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:



<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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum