Advertisement
_officialdave

Restore Xcrud BLOB storage in MySQL.

Aug 4th, 2020 (edited)
1,979
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. /*
  2. * In xcrud.php, look for this line $postdata = $this->check_postdata($postdata, $this->primary_val); around line 3093
  3. * Immediately below this line paste the code block you see below.
  4. * Tested on Xcrud v1.6.26
  5. */
  6.  
  7. if ($this->upload_config)
  8.         {
  9.             foreach ($this->upload_config as $key => $opts)
  10.             {
  11.                 if (isset($opts['blob']) && $opts['blob'] && isset($postdata[$key]) && $postdata[$key] != '')
  12.                 {
  13.                     if ($postdata[$key] == 'blob-storage')
  14.                     {
  15.                         unset($postdata[$key]);
  16.                         continue;
  17.                     }
  18.                     else
  19.                     {
  20.                         $folder = $this->upload_folder[$key];
  21.                         $path = $folder . '/' . $postdata[$key];
  22.                         if (is_file($path))
  23.                         {
  24.                             $postdata[$key] = file_get_contents($path);
  25.                             unlink($path);
  26.                         }
  27.                     }
  28.                 }
  29.             }
  30.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement