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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:05:59+00:00 2026-06-12T03:05:59+00:00

I am using php to upload and move a file to a desired location…

  • 0

I am using php to upload and move a file to a desired location…
while using move_uploaded_file, it says that the file has moved successfully but the file does not show up in the directory.
THE HTML AND PHP CODE IS BELOW…

 <form action="test_upload.php" method="POST" enctype="multipart/form-data">
<fieldset>
<label for="test_pic">Testing Picture</label>
<input type="file" name="test_pic" size="30" /><br />
</fieldset>

<fieldset>

<input type="submit" value="submit" />

</fieldset>
</form>

THe php goes like :

    <?php


$image_fieldname = "test_pic";
$upload_dir = "/vidit";
$display_message ='none';

if(move_uploaded_file($_FILES[$image_fieldname]['tmp_name'],$upload_dir) && is_writable($upload_dir)){
    $display_message = "file moved successfully";
    }
    else{
        $display_message = " STILL DID NOT MOVE";
            }



?>

when i run this page and upload a legitimate file – the test_upload.php echoes file uploaded successfully. but when i head on to the folder “vidit” in the root of the web page. the folder is empty…

I am using wamp server .

  • 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-12T03:06:00+00:00Added an answer on June 12, 2026 at 3:06 am

    You need to append filename into your destination path. Try as below

    $doc_path = realpath(dirname(__FILE__));
    
    if(move_uploaded_file($_FILES[$image_fieldname]['tmp_name'],$doc_path.$upload_dir.'/'.$_FILES[$image_fieldname]['name']) && is_writable($upload_dir)){
        $display_message = "file moved successfully";
    }
    else{
        $display_message = " STILL DID NOT MOVE";
    }
    

    See PHP Manual for reference. http://php.net/manual/en/function.move-uploaded-file.php

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

Sidebar

Related Questions

I am trying to upload file using php. I am using the function move_uploaded_file.
I am running WAMP server. On file upload using PHP I see $_FILES[tmp_name] =>
i am developing register form using php where i need to upload the file
I am using PHP to upload a file and then I want to grab
I'm using a form to upload a file using php. It works fine but
I am currently using php and ajax file upload to develop a web application.
I'm using uploadify (a jQuery uploading) script, which has basically a PHP file at
I'm trying to upload a file using PHP. My HTML page with the form
I have been using to upload an image file from HTML5/JS and using PHP
I am trying to upload a file to a sever using PHP. I cannot

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.