0

I must download json document from github, but for moment,I don't know why I have a document with the size = 0 on my cache file. I would know if it's possible before to save the document in the cache to know the size.

Tk

There the portion of code.

$file_link = $content_download_file->download_url;

$file_json_content = file_get_contents($file_link, true, $this->context);

===> possible to know thesize here  of $file_json_content ?

file_put_contents($this->saveFileIntoCacheFilesTemp . '/' . $module_name, $file_json_content);
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Denis
  • 45
  • 5
  • Possible duplicate of [PHP: Remote file size without downloading file](https://stackoverflow.com/questions/2602612/php-remote-file-size-without-downloading-file) – SystemGlitch Jul 24 '18 at 14:56
  • I would look at `strlen($file_json_content);` as a JSON String is in fact just a string.And then possibly `mb_strlen($file_json_content);` – RiggsFolly Jul 24 '18 at 15:58

0 Answers0