Advertisement
Guest User

Untitled

a guest
Aug 9th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. $ftp_server = "ftp.tapanovisual.esy.es";
  4. $ftp_user = "u446707633.thiagomelo";
  5. $ftp_pass = "*****";
  6. $imageCodificada = $_POST['imageCodificada'];
  7.  
  8.  
  9. //DECODIFICAR IMAGEM
  10. $imageDecodificada = base64_decode($imageCodificada);
  11.  
  12.  
  13. // set up a connection or die
  14. $conn_id = ftp_connect($ftp_server) or die("Não foi possível estabelecer conexão com $ftp_server");
  15.  
  16. // try to login
  17. if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  18. echo "Conectado! na $ftp_user@$ftp_servern";
  19. file_put_contents(include($_SERVER['DOCUMENT_ROOT']."/public_html/imagens/fotos_func/TESTE.jpg"), imageDecodificada);
  20.  
  21.  
  22.  
  23. } else {
  24. echo "Não foi possível estabelecer conexão com $ftp_usern";
  25. }
  26.  
  27. // close the connection
  28. ftp_close($conn_id);
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement