hide error on open - still happens occasionally, even though we have done loads of...
authorAlan <alan@roojs.com>
Fri, 22 Apr 2022 07:39:09 +0000 (15:39 +0800)
committerAlan <alan@roojs.com>
Fri, 22 Apr 2022 07:39:09 +0000 (15:39 +0800)
File/Convert.php

index b63d201..b51cbb0 100644 (file)
@@ -304,9 +304,11 @@ class File_Convert
             exit;
         }
         //var_dump($fn, $mt); exit;
-         header('Content-type: '. $mt);
+        header('Content-type: '. $mt);
         
-        $fh = fopen($fn, 'rb');
+        
+        // even though we have done a file_exists above - it still errors out here occausionally.
+        $fh = @fopen($fn, 'rb');
         //fpassthru($fh);
         
         // passthrough seems to have problems -- trying fread
@@ -322,7 +324,7 @@ class File_Convert
         }
         
         if ($delete_after) {
-            unlink($fn);
+            @unlink($fn);
         }
         exit;