Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $img = $this->getRequest()->getData('image');
  2.  
  3. $folderPath = '\\ts-rackstation\Shared\Doyle\PROGRAMMERS\pics\Staff\';
  4. if (!filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN)) {
  5. $folderPath = '\\ts-rackstation\pics\Staff\';
  6. }
  7.  
  8. $image_parts = explode(";base64,", $img);
  9.  
  10. $image_base64 = base64_decode($image_parts[1]);
  11.  
  12. $newImage = imagescale($image_base64, 322, 255, IMG_BICUBIC_FIXED);
  13.  
  14. $fileName = $employeeSelections['employee'] . '.jpg';
  15. $file = $folderPath . $fileName;
  16. file_put_contents($file, $newImage);
  17.  
  18. file_put_contents($file, $img);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement