tags:

views:

190

answers:

2

When you handle an HTTP upload, the file is uploaded to $_FILES['field_name']['tmp_name'], I know I could extract the temp path from there.
But I was expecting maybe a $_SERVER[] param that had the temp path (there's none) or other elegant way of knowing it. Is there any?

+6  A: 

sys_get_temp_dir()

Ionuț G. Stan
Available since PHP 5.2.1.
Gumbo
Returns C:\Windows\TEMP\. My snippet returns D:/WAMP/tmp.
Sbm007
WAMP is preconfigured to use the tmp dir of the distribution.
Ionuț G. Stan
+7  A: 
ini_get('upload_tmp_dir');
Sbm007
That's true too. +1
Ionuț G. Stan
This is probably the more correct answer, as the upload temp dir may be different from the system temp dir.
notJim