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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:08:34+00:00 2026-05-25T17:08:34+00:00

I have uploaded a file using HTML / PHP and following is the print_r()

  • 0

I have uploaded a file using HTML / PHP and following is the print_r() of the $_FILES[‘file’] array:

Array
(
    [name] => Chrysanthemum.jpg
    [type] => application/octet-stream
    [tmp_name] => G:\xampp\tmp\php82DB.tmp
    [error] => 0
    [size] => 879394
)

As you can see above, the temp file is stored in the tmp_name directory. I need to get that directory path using PHP. How do I get it ?

Tried using sys_get_temp_dir() but this is what it returns me.

I do NOT want to get the directory from the array or from the file upload data. I want to dynamically get the php file uploads directory using a function.

C:\Users\admin\AppData\Local\Temp
  • 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-25T17:08:35+00:00Added an answer on May 25, 2026 at 5:08 pm
    $tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have an application that receives an uploaded file from my web application.
I have a byte array filled from a file uploaded. But, in another part
I have a Windows/Apache2/PHP app that receives file using chunked encoding. The reason is
I have read the following tutorial Uploading Files To the Server Using PHP and
I have a document library in SharePoint. When a new file is uploaded to
i have an swf file, uploaded in server. But whenever I make changes to
I have an upload form with a file to be uploaded. The issue I
I have a Perl script which will allow for a file to be uploaded
I have just uploaded an image to imageshack using their API and I am
Possible Duplicate: HTML Compress File Upload? I have complains from client that my website

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.