Changeset 1971


Ignore:
Timestamp:
04/28/10 06:09:57 (5 years ago)
Author:
lowjoel
Message:

We will upload a blank file to the path we are deleting before we rm the file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/website/scripts/BuildPublish.php

    r1970 r1971  
    4949    curl_setopt($curl, CURLOPT_USERPWD, sprintf('%s:%s', $username, $password)); 
    5050 
    51     //Don't output to stdout 
    52     $tempOutput = fopen('php://temp', 'w'); 
    53     curl_setopt($curl, CURLOPT_FILE, $tempOutput); 
     51    //Create a temp stream to upload to the old path (to zero the length) 
     52    $stream = fopen('php://temp', 'r'); 
     53    curl_setopt($curl, CURLOPT_UPLOAD, true); 
     54    curl_setopt($curl, CURLOPT_INFILE, $stream); 
    5455 
    5556    //Parse the URL to get the path to delete 
    5657    $path = parse_url($url, PHP_URL_PATH); 
    57     curl_setopt($curl, CURLOPT_QUOTE, array(sprintf('rm "%s"', $path))); 
     58    curl_setopt($curl, CURLOPT_POSTQUOTE, array( 
     59        sprintf('rm "%s"', $path) 
     60    )); 
    5861 
    5962    if (curl_exec($curl) === false) 
    6063        throw new Exception('cURL Error: ' . curl_error($curl)); 
    61     fclose($tempOutput); 
     64    fclose($stream); 
    6265    curl_close($curl); 
    6366 
Note: See TracChangeset for help on using the changeset viewer.