Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. // Make sure we've been sent an image url
  2. if (!isset($_GET['file'])) {
  3. echo "Sorry, no image URL was sent.";
  4. exit();
  5. }else{
  6. var_dump($_GET);
  7. }
  8.  
  9. $image_url = $_GET['file'];
  10. $newfilename = $_GET['newfilename'];
  11.  
  12. // Download the image data from Picnik's servers
  13. $image_data = file_get_contents( $image_url );
  14. //var_dump($image_data);
  15. if (FALSE === $image_data) {
  16. // Download failed ... this shouldn't happen very often,
  17. // but you might want to put some retry logic in your app
  18. echo "Sorry, the image download failed.";
  19. exit();
  20. }
  21.  
  22. move_uploaded_file($_FILE["file"]["tmp_name"],
  23. "photos/" . $newfilename);
  24. $recordID = $_GET['recordID'];
  25. echo "<br><br><br><br><br><div align='center'>PHOTO UPDATED SUCCESSFULLY</div>";
Add Comment
Please, Sign In to add comment