1

I am using amazons s3 upload which has content-type

array('starts-with', '$Content-Type', 'image/'),

ok so this is set to image the problem i am having is when upload a js file with this it adds it to amazon s3 as a image you can view the file here. https://s3.amazonaws.com/s3fileshare.mplayer/lightbox.js

So you can see its a js file but its being uploaded with image settings here is the file if i use amazon s3 built in uploader https://s3.amazonaws.com/s3fileshare.mplayer/test/lightbox.js as you can see that opens fine as a js file.

So what i am asking is how do you set the content-type for all types off files.

// prepare policy
$policy = base64_encode(json_encode(array(
    // ISO 8601 - date('c'); generates uncompatible date, so better do it manually
    'expiration' => date('Y-m-d\TH:i:s.000\Z', strtotime('+1 day')),  
    'conditions' => array(
        array('bucket' => $bucket),
        array('acl' => 'public-read'),
        array('starts-with', '$key', ''),
        // for demo purposes we are accepting only images


       //Vvvvvvvvvv this line below vvvvvvvvvvvV
        array('starts-with', '$Content-Type', 'image/'),
        array('success_action_status' => '201'),
        array('starts-with', '$name', ''),  
        array('starts-with', '$Filename', ''), 
    )
)));

any suggestions

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.