简体   繁体   中英

How do I set the File Expire Header with Rackspace CloudFiles PHP API

I am currently writing a php backup script that backs up a website and its mysql databases to Rackspace CloudFiles. I have the script working well, except I don't know how to set the expire headers so the backups are automatically deleted after 7 days. As far as I can find, Rackspace has not documented the PHP API very well.

This is what I am trying to do, in reference to their regular API documentation.

http://docs.rackspace.com/files/api/v1/cf-devguide/content/Expiring_Objects-e1e3228.html

Thanks for your help!

I think that you just have to add X-Delete-At header to the file.

$object->headers = array('X-Delete-At'=> 1339429105); // unix timestamp
$obj->sync_metadata();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM