• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

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