• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Rename filename on API

aladdin

Chevereto Member
Hi, can you help me? When i upload images from my compyter, filename in chevereto - changes. But when i upload from URl, imagename in not changes.

From Comp
PHP:
list($width, $height, $type, $attr) = getimagesize($_FILES['upload']['tmp_name'][$i]);


    //set POST variables
    $url = 'http://xxxxxxxxxxx/api';
       
    $fields = array(
                        'key' => urlencode('xxxxxx_api'),
                        'upload' => base64_encode(file_get_contents($_FILES['upload']['tmp_name'][$i])),
                        'format' => urlencode('txt')
                    );

if($width>1920) $fields['resize_width'] = 1920;

    //open connection
    $ch = curl_init();



    //set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, sizeof($fields));
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 240);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: '));

    //execute post
   
    $result = curl_exec($ch);

From URL

PHP:
list($width, $height, $type, $attr) = getimagesize($urls[$i]);



    //set POST variables
      $url = 'http://xxxxxxxxxxx/api';
    $fields = array(
                        'key' => urlencode('xxxxxx_api'),
                        'upload' => $urls[$i],
                        'format' => urlencode('txt')
                    );
if($width>1920) $fields['resize_width'] = 1920;

    //open connection
    $ch = curl_init();



    //set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, sizeof($fields));
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 240);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: '));

    //execute post
   
    $result = curl_exec($ch);

Can i change imagename when upload from url?
 
Back
Top