Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6899473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:25:33+00:00 2026-05-27T07:25:33+00:00

I tried a file upload to my amazon s3 refering this tutorial http://www.anyexample.com/programming/php/uploading_files_to_amazon_s3_with_rest_api.xml But

  • 0

I tried a file upload to my amazon s3 refering this tutorial
http://www.anyexample.com/programming/php/uploading_files_to_amazon_s3_with_rest_api.xml

But I got the following error

HTTP/1.1 403 Forbidden
x-amz-request-id: 10F111F91A85CFC5
x-amz-id-2: 6pBJs+OKZOZdTF3zQw0MLM62zGAAsCFyeJsv/xzYB+wM7+7RnZU+k1rtcpTWC8VS
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Fri, 02 Dec 2011 09:35:21 GMT
Server: AmazonS3

2bf
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<StringToSignBytes>50 55 54 0a 0a 0a 46 72 69 2c 20 30 32 20 44 65 63 20 32 30 31 31 20 30 39 3a 33 37 3a 35 30 20 2b 30 30 30 30 0a 2f 74 61 6e 65 77</StringToSignBytes>
<RequestId>10F111F91A85CFC5</RequestId>
<HostId>6pBJs+OKZOZdTF3zQw0MLM62zGAAsCFyeJsv/xzYB+wM7+7RnZU+k1rtcpTWC8VS</HostId>
<SignatureProvided>6V2sLdHEJ9uWZO0G81q5QQzSa9Y=</SignatureProvided><StringToSign>PUT

Any Ideas
Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:25:34+00:00Added an answer on May 27, 2026 at 7:25 am

    Without having your code to view it’s hard to help but here is some example code that you might find helpful:

    class myS3Helper{
    public function getSignedImageLink($timeout = 1800, $my_aws_secretkey, $my_aws_key)
    {
    
        $now = new Zend_Date(); //Gives us a time object that is set to NOW
        $now->setTimezone('UTC'); //Set to UTC a-la AWS requirements
        $now->addSecond($timeout); //set the time in the time object to a point in the future
        $expirationTime = $now->getTimestamp(); //returns unix timestamp representation of the time.
    
        $signature = urlencode(
                base64_encode(
                        hash_hmac(
                                'sha1', $this->_generateStringToSign($expirationTime),
                                $my_aws_secretkey, 
                                true
                                )
                        )
                );
    
        //Yes - this is ugly but hopefully readable 
        $url = 'https://';
        $url .= Zend_Service_Amazon_S3::S3_ENDPOINT; //e.g s3.amazonaws.com
        $url .= $this->_getImagePath(); //e.g /mybucket/myFirstCar.jpg
        $url .='?AWSAccessKeyId=' . $my_aws_key;
        $url .='&Signature=' . $signature; //signature as returned by below function
        $url .='&Expires=' . $expirationTime;
    
        return $url;
    
    
    }
    
    protected function _generateStringToSign($expires)
    {   
    
        $string = "GET\n"; //Methods
        $string .= "\n";
        $string .= "\n";
        $string .= "$expires\n"; //Expires
        $string .= $this->_getImagePath();
    
        return $string;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the multi-upload plugin found at: http://www.fyneworks.com/jquery/multiple-file-upload/ This is what I am
i tried to implement the file upload via doctrine/lifecycle callbacks as described here: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html#using-lifecycle-callbacks
I'm trying to upload files via this jQuery plugin: http://aquantum-demo.appspot.com/file-upload I am able to
I took this basic upload file script from php.net and it is giving two
I tried to read a file in a view like this: def foo(request): f
I tried to open a file with fopen() function in PHP and it output
I tried this code to open a file in Python: f = open("/Desktop/temp/myfile.txt","file1") It
I am currently using php and ajax file upload to develop a web application.
I'm coding a form using PHP and jQuery. I have a file upload field
I have a standard file upload script using this script. When the upload is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.