About downloading the bulk media, photos

Hello @ashish7654, I had same issue of downloading large attachment file. I solved through api request. using curl … This is the script that gets the attachment
$ch = curl_init();
//your username and password for authentication
$username = ‘’;
$password = '
’;
$authorization = “Authorization: Token your-token-api-here”;
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’, $authorization));
curl_setopt($ch, CURLOPT_USERPWD, “$username:$password”);
// set url
curl_setopt($ch, CURLOPT_URL, “https://kc.kobotoolbox.org/attachment/original?media_file=user_name/attachments/image_name”);

        //return the transfer as a string
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            'Content-Type: application/json',
            'Connection: Keep-Alive'
        ));

        // $output contains the attachment file
        $output = curl_exec($ch);

        // close curl resource to free up system resources
        curl_close($ch);
1 Like