[function.file-put-contents]: failed to open stream: File name too long

15 sec read

Error: [<a href=’function.file-put-contents’>function.file-put-contents</a>]: failed to open stream: File name too long

To solve this error you need to rename the filename so that the filename and extention together are no more than 255 characters, an easy way to do this is

$filename=substr($name,0,251).'.pdf';

Note, that we used the character count 251 since 251 + the 4 characters for the extention together add up to 255 characters.

Last Updated On March 22, 2018

Leave a Reply

avatar
  Subscribe  
Notify of