Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filetime and filesize warnings #20

Open
oleteacher opened this issue Mar 4, 2019 · 5 comments
Open

Filetime and filesize warnings #20

oleteacher opened this issue Mar 4, 2019 · 5 comments

Comments

@oleteacher
Copy link

Hey, great simple little script! Thanks for sharing.

I followed instructions @ #5 to change listing dir and it works, but getting errors like:

Warning: filemtime(): stat failed for test.csv in /opt/lampp/htdocs/testbed/filelister/filelister.php on line 243

Warning: filesize(): stat failed for test,.csv in /opt/lampp/htdocs/testbed/filelister/filelister.php on line 198

Any ideas how to solve and get the time / size showing? File Size show 0 and time is THU. JANUARY 1ST, 1970 - 01:00AM

Running PHP 7.3

Thanks again.

@ukadmin
Copy link

ukadmin commented Mar 8, 2019

Hey, I think same Problem is here.. But only when i include it to my template. When i use it itselfe no Problems. You can solve it?

filemtime(): stat failed for

@oleteacher
Copy link
Author

Pretty sure something to do with path, but found no solution.

@ukadmin
Copy link

ukadmin commented Mar 9, 2019

there must be a way to change the path. You have the index.php in your folder directory or you include ?

@oleteacher
Copy link
Author

"there must be a way to change the path. You have the index.php in your folder directory or you include ?"

Path is not the real issue. I have the index.php in the directory, not include.

The issue is after making mod mentioned in #5

Once the path is set:

$items = scandir( dirname(__FILE__) . '/pdf/files' );

I have the warnings and 0 byte files size.

@harrier77
Copy link

Hello, I tried to use the script outside its folder (something like "../folder/etc"). To make it working I needed to change the function ext() in this way, I think it can solve the warnings:

function ext($filename)
{
if (is_dir($filename)==false):
return substr( strrchr( $filename,'.' ),1 );
else:
return false;
endif;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants