php - Rackspace Cloud Files API: 404 Error -
i'm using following curl request post file rackspace cloud files:
$ch = curl_init(trim($rackspace['x-storage-url']).'/container/hello'); curl_setopt($ch, curlopt_httpheader, array('x-auth-token: '.$rackspace['x-auth-token'], 'content-length: '.$data['file']['size'])); curl_setopt($ch, curlopt_put, true); curl_setopt($ch, curlopt_infile, fopen($data['file']['path'], 'r')); curl_setopt($ch, curlopt_infilesize, $data['file']['size']); curl_setopt($ch, curlopt_header, true); echo curl_exec($ch);
i'm following rackspace documentation, i'm getting 404 not found
error , i'm not quite sure how troubleshoot this. suggestions?
solution
after further analysis, discovered x-storage-url issued after authenticating https://storage101.dfw1.clouddrive.com
. dfw1 indicates data center in dallas, containers created in chicago. confirm problem, created container @ dallas data center , tried again – worked fine. submitted ticket rackspace have default storage location changed chicago. working now.
as pointed out in selected answer, if had been using up-to-date version of api (2.0), have been presented urls both locations.
it sounds you're using old v1.0 authentication method shown in api docs here. doing return default storage location. however, v2.0 of api auth system described here, authentication response contain 2 different cloud files endpoint urls, 1 each data center. these both point same api, though, of other cloud files-related code should "just work" if swap out authentication code.
Comments
Post a Comment