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

  • Home
  • SEARCH
  • 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 1115199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:07:21+00:00 2026-05-17T03:07:21+00:00

I created a simple file browser in PHP that links to the files through

  • 0

I created a simple file browser in PHP that links to the files through generation expiring query URLs. So for each access to a directory, a link to each file is generated that is valid for say 900 seconds.

I now have the problem that the generated signatures seem to fail sometimes. Which is strange, since I intentionally used external S3 libraries for generating the URLs and signatures.

In fact, I tried the following libraries to generate the signatures:

  • CloudFusion
  • S3 generator
  • Amazon S3 PHP class

The libraries internally use hash_hmac(‘sha256’, … or hash_hmac(‘sha1’, … – I also don’t understand why differnet hash algorithms are used.

Since the problem is the same with all libraries, it could as well be in my URL generation code, which is straightforward though:

$bucket = "myBucket";
$filename = $object->Key;
$linksValidForSeconds = 900;
$url = $s3->get_object_url($bucket, $filename, $linksValidForSeconds);

Sp $bucket and $linksValidForSeconds are constant, $filename is e.g. “Media/Pictures/My Picture.png”. But event for same variables, it sometimes works, soemtimes doesn’t.

Any ideas?

Edit: Typo/Wrong constant variable name fixed (thanks)

  • 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-17T03:07:22+00:00Added an answer on May 17, 2026 at 3:07 am

    I found the problem and it had nothing to do with the code I mentioned. The generated URL is urlencode()’d and sent to another PHP script. There I use the URL to display an image from S3. I used urldecode() there to undo the changes but apparently this is not neccesary.

    So each time the signature contains certain chars, the urldecode() would change them and corrupt it.

    Sorry for omitting the actual problem code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll create a EML file with an attachment using JavaMail. I created a simple
I am attempting to build a simple method that creates an XML file from
I would like to create a simple file format/DSL which would allow my users
I created a simple .NET windows application in Visual Studio 2005 and on just
I created a simple dialog-based application, and in the default CDialog added three buttons
I've created a simple desktop application in C# 3.0 to learn some C#, wpf
I've created a simple httpModule, registered it on GAC and added it to the
I have created a simple wcf service which used the WCF Service Library template.
I've created a simple user control which is manually created with something like MyUserControl
I have created a simple grid of divs by left floating them and an

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.