filesize stat failed

后端 未结 1 1015
借酒劲吻你
借酒劲吻你 2020-12-07 04:33

I have a php script running, which loops through all files in a specified directory. It returns name, filesize, modified_date etc. for each file it finds. The script returns

相关标签:
1条回答
  • 2020-12-07 05:14

    I've encountered this before; file system encoding is difficult and hard to predict, but this usually works for me:

    stat(iconv('UTF-8', 'ISO-8859-1', $filename));
    

    It just converts the filename from utf8 to iso8859-1 and tries.

    This is tricky though, just look at this page for a juicy dialog in the post comments: http://www.rooftopsolutions.nl/blog/filesystem-encoding-and-php

    0 讨论(0)
提交回复
热议问题