Quantcast
Channel: Why does PHP store uploaded files in a temporary location and what is the benefit? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

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

$
0
0

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 all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images