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 181213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:43:20+00:00 2026-05-11T14:43:20+00:00

I am getting varied results with some PHP code I have written to upload

  • 0

I am getting varied results with some PHP code I have written to upload files to S3 then call an EC2 instance to perform actions on the uploaded file.

Here is the order I do things –

1) use S3 class to put file

$result = s3 -> putObjectFile($uploadDIR, $bucket, $name, S3::ACL) 

2) check $result

if($result == '1') { //file made it to s3 

3) use cURL to call EC2 instance and perform action on file in S3

I am using this with video files, when I upload a small video file it works ok (eg 3MB) but for larger video (eg 80MB) the code doesnt seem to get past step 1. The file is moved to s3 ok but my guess is that after a while PHP gives up waiting to see if $result == 1 and so does not execute the rest of the code.

What is the best way to handle something like this? How can I detect that the file has been uploaded to S3 and then run some code when it has?

  • 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. 2026-05-11T14:43:20+00:00Added an answer on May 11, 2026 at 2:43 pm

    For big files the time it takes to upload them will probably be higher than the script’s max_execution_time.

    You could just use the set_time_limit() function but it’s still probably not a good idea for web pages as the script would just ‘hang’ there without any user feedback (output to the browser).

    This would probably be nicer:

    1. use set_time_limit() so the script doesn’t die.
    2. Store the file name in a temporary location (DB, session, etc) and get a unique ID for it
    3. Output a page with some AJAX code to (repeatedly) query a second script for the file’s status (FINISHED, FAILED, UNDEFINED?)
    4. On the original script, wait for the action to finish and update the DB with the result.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 90k
  • Answers 90k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer add this in the class: friend std::ostream& operator<< (std::ostream& out,… May 11, 2026 at 6:01 pm
  • Editorial Team
    Editorial Team added an answer I think it is completely subjective, however, I think it… May 11, 2026 at 6:01 pm
  • Editorial Team
    Editorial Team added an answer The Microsoft currently has time limited action where it is… May 11, 2026 at 6:01 pm

Related Questions

I am converting about 4000 text files that contain HTML into MySQL database entries.
This is more of a generic regex question than a PHP-specific one. I am
I'm using org.apache.commons.net.ftp.FTPClient and seeing behavior that is, well... perplexing. The method beneath intends
I am getting back into a bit more .NET after a few-years of not

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.