1

Is there any CURL Simulator for PHP? My Host does not have CURL enabled. I look for some PHP Equivalent with the same Commands as CURL have. You know such a Solution? Or i have to change the Code? How i can make a POST API-Call with a File-Upload without CURL?

I need this Equivalent:

    $file_name_with_full_path = dirname(__FILE__) . "/temp/" . $sFileName;

    $post = array(   'ApiKey' => '6548dcsdf'
                    ,'File' => '@'.$file_name_with_full_path
                    ,'WorksheetIndex' => 1
                    ,'WorksheetActive' => 'True'
                    ,'WorksheetName' => 'Rechnung'
                );


    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,"https://do.convertapi.com/Excel2Pdf");
    curl_setopt($ch, CURLOPT_POST,1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);

    $result = curl_exec( $ch );

    curl_close( $ch );

1 Answers1

0

I never found the curl equivalent with same commands. You can make your own upload function quite easily, using file_get_contents.

For example:

Upload a file using file_get_contents

Community
  • 1
  • 1
c-toesca
  • 947
  • 1
  • 11
  • 13