0

I am uploading my files to owncloud using curl request. If connection interrupts how can resume the upload? because i have to upload large files. Below is my code

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://server/owncloud/remote.php/webdav/' . basename($filename));
    curl_setopt($ch, CURLOPT_NOPROGRESS, false );
    curl_setopt($ch, CURLOPT_FAILONERROR, true); 
    curl_setopt($ch, CURLOPT_USERPWD, "user:password");
    curl_setopt($ch, CURLOPT_PUT, 1);

    $fh_res = fopen($file_path_str, 'r');

    curl_setopt($ch, CURLOPT_INFILE, $fh_res);
    curl_setopt($ch, CURLOPT_INFILESIZE, filesize($file_path_str));


    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
    $curl_response_res = curl_exec ($ch);

How to continue the upload if the connection interrupts?

augustine jenin
  • 424
  • 4
  • 10

0 Answers0