https://www.icyphoenix.com/viewtopic.php?f=35&t=6238&p=42448#p42448
-----------------------------------
Danielc
Fri 07 Aug, 2009 23:02

Re: No Thumbnail After Changing Server In External Pictures
-----------------------------------
No body knows???
I'm trying to make a code in the image_thumbnail.php file to upload the file first to my server, with this:
[code]$grab = curl_init();
$tmppath = $_SERVER['DOCUMENT_ROOT'] . "/tmp/";
curl_setopt($grab, CURLOPT_URL, $pic_fullpath);
curl_setopt($grab, CURLOPT_HEADER, false);
curl_setopt($grab, CURLOPT_RETURNTRANSFER, true);
$grabbed = curl_exec($grab);
curl_close($grab);
$filename = strtolower(md5((rand() * time()).$_SERVER['REMOTE_ADDR']) . "." . $pic_filetype);
$file = fopen($tmppath.$filename, 'w');
fwrite($file, $grabbed);
fclose($file);

$pic_id = $tmppath . $filename;
$pic_fullpath = $tmppath . $filename;
$pic_fullpath = str_replace(array(' '), array('%20'), $pic_id);
$pic_id = str_replace('http://', '', str_replace('https://', '', $pic_id));
$archivo = fopen("texto.txt","w");
fwrite($archivo, $pic_fullpath . "  " . $pic_id . PHP_EOL);

$pic_path[] = array();
$pic_path = explode('/', $pic_id);
$pic_filename = $pic_path[count($pic_path) - 1];
$file_part = explode('.', strtolower($pic_filename));
$pic_filetype = $file_part[count($file_part) - 1];
fwrite($archivo, "El nombre del archivo es $pic_filename y su extension es $pic_filetype" . PHP_EOL);

@chmod($tmppath.$filename, 0777);[/code]
But i can't get it work... Pleaseeeeeeeeeeee Help me!!!
What's the difference between the "uploader" of "upload.php" and my code?

Please help me!


