Quantcast
Viewing latest article 4
Browse Latest Browse All 4

Why does PHP store uploaded files in a temporary location and what is the benefit?

Okay I'm totally new in this field and going through some tutorials and I found that while uploading files in PHP it stores them in a temporary location.

$file_temp=$_FILES['file']['tmp_name'];$file_loc="Upload".$file_name;move_uploaded_files($file_temp,$file_loc);

Now why doesn't PHP allow uploading files directly to the desired location? Why they are stored in a temporary location with a .tmp extension and what benefit do we get from this strategy?


Viewing latest article 4
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>