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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:39:58+00:00 2026-06-10T16:39:58+00:00

I just recently moved my local MAMP installation to my live Ubuntu EC2 server

  • 0

I just recently moved my local MAMP installation to my live Ubuntu EC2 server and I’m having a devil of a time accessing file uploads. Everything looks like it should be working okay, but I don’t know why it’s not. I have a max upload of 5MB in in the php.ini, which should be plenty for uploading photos, so I know that’s not it. Haven’t changed the default directory, but thinking maybe I should as the domain’s on an Apache virtual host with 2 other domains? I don’t want to go this route in my php scripts:

ini_set('upload_tmp_dir','/your-home-www/tmp/');

but will, if it’s absolutely necesary for the virtual host to process the files. I’m pretty sure it’s not my code, as it works flawlessly on my localhost MAMP installation but here’s the snippet of code that processes the photos if it helps:

$fileTmpLoc = $photo["tmp_name"];
$fileSize = $photo["size"]; 

if (!$fileTmpLoc) { // if file not chosen
      sendResponse(404,"ERROR: Photo not sent.");
      exit;
} else if($fileSize > 5242880) { // if file size is larger than 5 Megabytes
      unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder
      sendResponse(413, "ERROR: Your file was larger than 5 Megabytes in size.");
      exit;
} else {
$newName = "image01.jpg";

    $moveResult = copy($fileTmpLoc, "members/$id/".$newName);
    if ($moveResult != true) {
         @unlink($fileTmpLoc); 
         sendResponse(404,"ERROR: File not uploaded. Try again.");
         exit;
    }
 ....
}

Now, it makes it all the way down to sendResponse(404,”ERROR: File not uploaded. Try again.”);, so maybe it has nothing to do with the tmp file, but it is still not uploading. And the members directory and the $id directory for the user are both set to 777, so I literally have no clue what’s going on. This is coming from an IOS client, not an html form

  • 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-06-10T16:40:00+00:00Added an answer on June 10, 2026 at 4:40 pm

    You have to use the standard PHP function

    move_uploaded_file()
    

    to move an uploaded file to its place.

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

Sidebar

Related Questions

So just recently, my async server code which relies on pthread_mutex_timedlock seem to have
We just recently moved our DB from 9i to 10G (Yes..better late than never
I've just recently moved a lot of my Views and Controllers into more appropriate
My file directories have not changed, but every time I move from local host
I just recently moved a SQL DB from SQL2005 32 bit --> 64 bit.
I'm working with a client and we just recently moved their website from Godaddy
I have moved my server from dreamhost to Godaddy recently When I was with
I recently moved website to a new host. The server setup is very similar.
I recently moved my development to a Windows 7 machine, and am having all
Just recently I've installed the Qt libraries on my computer, and as a complete

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.