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

The Archive Base Latest Questions

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

Possible Duplicate: Unable to do File Upload in PHP I am trying to learn

  • 0

Possible Duplicate:
Unable to do File Upload in PHP

I am trying to learn to write file upload script in PHP. I don’t know why this doesn’t work. Please have a look


<?php
$name=$_FILES["file"]["name"];

if(isset($name)) {
    if(!empty($name)) {
        echo $name;
    }
    else {
        echo 'Please choose a file';
    }
}
?>

It gives an error message Notice: Undefined index: file in


The html part is


<form action="submissions.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" id="file" /> 
<input type="submit" name="submit" value="Submit" /></form>

I am using wamp on Windows. What may be the cause for the error ?

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

    The clue is in the error message. The index ‘file’ doesn’t exist in the FILES array. At a guess because you have this code before you’ve sumitted the form?

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

Sidebar

Related Questions

Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: Some issues trying to read a file with cbc.read.table function in R
Possible Duplicate: Image uploading via PHP returning empty array I am unable to successfully
Possible Duplicate: Simple and clean xml manipulation in PHP I trying to reference specific
Possible Duplicate: Unable to process application info.plist validation at this time due to a
Possible Duplicate: Unable to locate tools.jar I'm trying to use ant to compile using
Possible Duplicate: Unable to connect to internet in Blackberry device? I'm trying to send
Possible Duplicate: Android RuntimeException: Unable to instantiate the service I am trying to run
Possible Duplicate: error: Unable to find vcvarsall.bat I'm trying to install MySql interface for
Possible Duplicate: Unable to process application info.plist validation at this time due to a

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.