سؤال

I've been using the latest PHP SDK and have managed to create a simple script (https://gist.github.com/nickweavers/9936267) to create a container, upload objects into it, list and view them. But Can someone tell me if the SDK is able to figure out the mime types of files that are uploaded and make that info available to us or do we need to store it in the file objects meta data? At the moment my test script has a header("Content-Type: application/pdf"); hard coded, and I would like to handle this automatically.

TIA, Nick

هل كانت مفيدة؟

المحلول

CloudFiles should be detecting the content type for you (by extension), as long as you don't explicitly state the type.

To make sure it detects the right content type on subsequent POSTs or PUTs, set X-Detect-Content-Type: True.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top