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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:40:56+00:00 2026-05-27T02:40:56+00:00

In the $_FILES global variable, when i used $_FILES[file][name] : I am getting the

  • 0

In the $_FILES global variable, when i used

  1. $_FILES["file"]["name"] : I am getting the name of the file which i am uploading.
  2. $_FILES["file"]["type"] : Here i am getting blank data. But when i used ISSET function on this variable ( isset($_FILES["file"]["type"]) ), it’s returning 1.
  3. $_FILES["file"]["size"] : It returning zero.

I really don’t know, what is the real cause of this issue?
(As i am observing this issue is not happening in case of creating a new record, i.e., add a new record in the table and upload the specified file to the server.
But, the said problem is happening only when i try to edit an existing record i.e., replacing the old file with a new file by uploading the new file.)

  • 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-27T02:40:57+00:00Added an answer on May 27, 2026 at 2:40 am

    From the manual…

    If no file is selected for upload in your form, PHP will return $_FILES['userfile']['size'] as 0, and $_FILES['userfile']['tmp_name'] as none.

    Also, isset returns true when you check $_FILES["file"]["type"] because it is set, that is the variable exists, but its value is empty. Instead of isset, use if (empty($_FILES["file"]["type"]))

    You should not trust $_FILES["file"]["type"] either as it can either be spoofed by the user, or just plain wrong.

    Do you get the above errors only if no file was uploaded? Or was a file uploaded? It may be that there was an error with the file so those parts of the array were not set.

    Post some more code and a more descriptive explanation of the problem and how you can reproduce it and we can help more.

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

Sidebar

Related Questions

I have used a static global variable and a static volatile variable in file
I have a header file variable.h where i declare all my global variable.Then i
I have a NSDate *date1 in class1 implementation file(I initialized it as Global variable).
Can a variable declared in one jsp file be used in another, if imported?
If I declare a global variable in a header file and include it in
is there a macro or a global variable which through which I can learn
I have declared a variable NSString sessionId; in app delegate file for global usage.
In classic asp you had the Global.asa file, what's the equivalent in .Net? I
I have 2 test and 1 production server. In my global.asax file - I
Imagine in the Global.asax.cs file I had an instance class as a private field.

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.