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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:16:56+00:00 2026-06-15T20:16:56+00:00

TLDR; How do I reference a temp file upload POSTed to a PHP script

  • 0

TLDR; How do I reference a temp file upload POSTed to a PHP script from within the PHP script?

I’m working on creating a web app (just for lab testing, doesn’t need much security) that allows me to upload and aggregate XML&XLS files.

I’ve got everything worked out except for how to work with the file itself after the user POSTs it to the server using an HTML form.

I have a form that POSTs the file to the server, and I have a PHP script that is set up to do something with the file, but I’m falling short on understanding how to reference the uploaded file from the PHP script on the server.

EG:

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

and I’m vaguely aware that when the file is posted the file exists in a temp directory on the server until Update_data.php finishes executing. That’s all fine and well, but I don’t know what that directory would be, or even if I need to configure PHP.ini in some specific way to allow this.

So, what I’m asking is:

How do I reference a temp file upload POSTed to a PHP script from within the PHP script?

Thanks.

  • 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-15T20:16:58+00:00Added an answer on June 15, 2026 at 8:16 pm

    $_FILES['file']['tmp_name'] contains the file name of the uploaded file on the server.

    Yu can use the move_uploaded_file() function to move the uploaded file to whatever location you need.

    This manual page contains all the information you need: http://php.net/manual/en/features.file-upload.post-method.php

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

Sidebar

Related Questions

TLDR: I'm looking for a way to serve web resources (css, jpg, etc) from
TLDR: Started with this question simplified it after got some of it working and
So, my converter app is finally working, but with one major problem. It's not
TLDR: What can you do to combine multiple CoffeeScript files into one JS file,
I have a web form where users submit resume info. Invariably, they copypaste from
TLDR; How do I read data from a table using Entity Framework, when the
tldr; When I run a rake task in a test app which uses an
TLDR; How to identify sockets in event based programming model. I am just starting
I'm working on a project using an Arduino and as such, I'm reading from
Update: This may be something that just isn't doable. See this TLDR: How do

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.