Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente bannato
    Registrato dal
    Feb 2011
    Messaggi
    146

    ImageHack invio [ultime modifiche]

    Mi esce Warning: rename(,/tmp/69f728459ca34ae624a4ed7ef4e650aa.jpg) [function.rename]: No such file or directory in /homez.406/epicfailh/www/imagem.php on line 4
    dove sbaglio?
    ho fatto questo:
    codice:
    <?php
    preg_match("/\.(gif|bmp|png|jpg|jpeg){1}$/i", $_FILES['foto']['http://www.repubblica.it/images/2011/03/03/162225740-191299b9-bfd5-4831-b945-1375c43ac90c.jpg'], $ext);
    $imagem_nome = md5(uniqid(time())) . "." . $ext[1];
    rename($_FILES['foto']['tmp_name'], "/tmp/" . $imagem_nome);
    
    $postData = array();
    $postData['fileupload'] = "@/tmp/" . $imagem_nome;
    $postData['submit']     = "Submit";
    $postData['key']         = "48FOPUVW3dfcb3dd7f5bf93120a456040cb2b51d";
    $postData['rembar']     = "yes";
    $postData['xml']        = "yes";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://www.imageshack.us/index.php");
    curl_setopt($ch, CURLOPT_POST, true );
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 240);curl_setopt($ch, CURLOPT_POSTFIELDS, $postData );
    
    $response = curl_exec( $ch );
    curl_close($ch );
    echo $response;
    ?>

  2. #2
    Utente di HTML.it L'avatar di brodik
    Registrato dal
    Jan 2009
    Messaggi
    765
    dove lo hai preso
    codice:
    $_FILES['foto']['http://www.repubblica.it/images/2011/03/03/162225740-191299b9-bfd5-4831-b945-1375c43ac90c.jpg']
    ? te lo sei inventato?
    eXvision

  3. #3
    Utente bannato
    Registrato dal
    Feb 2011
    Messaggi
    146
    confesso si

    va cambiato cosi?
    $_FILES['http://www.repubblica.it/images/2011/03/03/162225740-191299b9-bfd5-4831-b945-1375c43ac90c.jpg']

    come grazie per l'aiuto

  4. #4
    Utente di HTML.it L'avatar di brodik
    Registrato dal
    Jan 2009
    Messaggi
    765
    $_FILES è una variabile superglobale utilizzata di norma nell'upload di file dal computer dell'utente al server.. essa contiene i dati del file durante l'upload (dimensione, formato, nome, nome temporaneo, ecc), quindi usare $_FILES in quel modo non serve assolutamente a niente, anche perchè utilizzi un url al posto dell'indice...

    Codice PHP:
    <?php

    $immagine 
    "http://www.repubblica.it/images/2011/03/03/162225740-191299b9-bfd5-4831-b945-1375c43ac90c.jpg";
    preg_match("/\.(gif|bmp|png|jpg|jpeg){1}$/i"$immagine$ext);
    $imagem_nome md5(uniqid(time())) . "." $ext[1];
    $cartella "/tmp/".$imagem_nome;
    file_put_contents($cartellafile_get_contents($immagine));

    $postData = array();
    $postData['fileupload'] = $cartella;
    $postData['submit']     = "Submit";
    $postData['key']         = "48FOPUVW3dfcb3dd7f5bf93120a456040cb2b51d";
    $postData['rembar']     = "yes";
    $postData['xml']        = "yes";
    $ch curl_init();
    curl_setopt($chCURLOPT_URL"http://www.imageshack.us/index.php");
    curl_setopt($chCURLOPT_POSTtrue );
    curl_setopt($chCURLOPT_HEADERfalse);
    curl_setopt($chCURLOPT_RETURNTRANSFER,true);
    curl_setopt($chCURLOPT_TIMEOUT240);curl_setopt($chCURLOPT_POSTFIELDS$postData );

    $response curl_exec$ch );
    curl_close($ch );
    echo 
    $response;
    ?>
    eXvision

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.