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

The Archive Base Latest Questions

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

When uploading a file from iPhone, my code produces the following error: Warning: move_uploaded_file()

  • 0

When uploading a file from iPhone, my code produces the following error:

Warning: move_uploaded_file() Unable to move ‘/tmp/phpUcqFVq’ to ‘/var/www/ds1134/http.www.xxx.com/app/1316254141147.jpg’ in /var/www/ds1134/https.www.xxx.com/user.php on line 2866

$_FILES looks like:

 [file] => Array
 (
    [name]     => 1316250632283.jpg
    [type]     => 
    [tmp_name] => /tmp/phpFio7gb
    [error]    => 0
    [size]     => 35515
 )

My PHP code for uploading is:

if (move_uploaded_file($_FILES["file"]["tmp_name"], "/var/www/ds1134/http.www.xxx.com/app/".$_FILES["file"]["name"]))
{
    echo "done";
}
  • 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-25T19:50:27+00:00Added an answer on May 25, 2026 at 7:50 pm

    You could add some precondition checks to find out why the file could not be written:

    $tmpName = $_FILES["file"]["tmp_name"];
    $destDir = "/var/www/ds1134/http.www.xxx.com/app";
    $destName = $destDir.$_FILES["file"]["name"];
    
    if (!is_directory($destDir)
    {
        throw new Exception('Destination is not a directory.');
    }
    
    if (!is_writable($destDir))
    {
        throw new Exception('Destination directory is not writable.');
    }
    
    if (!preg_match('/^\d{13}\.jpg$/', $destName)
    {
        throw new Exception('Invalid destination filename given. Only accepting 13 digits plus ".jpg".');
    }
    
    $destination = $destDir.'/'.$destName;
    
    if (is_file($destination))
    {
        throw new Exception('Destination filename already exists.');
    }
    
    if (virus_found($tmpName))
    {
        throw new Exception('Upload file contains a virus.');
    }
    
    if (!imagecheck_validate_jpg($tmpName, 'color,24bit,size<1mb,in300x300,browser-compatible'))
    {
        throw new Exception('Uploaded file does not meet the image requirements.');
    }
    
    if (move_uploaded_file($tmpName, $destination))
    {
        echo "done";
    }
    else
    {
        throw new Exception('Unable to move file.');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing code for uploading a file from a client to my server
I am uploading a bunch of files from the iPhone to a web service.
I'm working on an iPhone application that involves uploading full photos from the camera
I am uploading a file from an iOS app onto S3 that can get
When uploading a file (jpeg) via a form in IE7 I am seeing a
I am running Ubuntu8.041. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch configured Can't get file uploading
Do web browsers send the file size in the http header when uploading a
I've been playing around with upgrading from an iPhone app to a Universal application,
I am strictly following the answers from How can I upload a photo to
I am trying to upload video from the iPhone application using FBConnect. Actually I

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.