php create temp file in system temp directory

Here you will find a  free php scripts, php resources, php tutorials, web resources , jquery

PHP inbult functions :


tempnam(),sys_get_temp_dir()
In php using this two function you can create temp file in temp directory of running system.

tempnam():Creates a file with a unique filename, with access permission set to 0600, in the specified directory. If the directory does not exist, tempnam() may generate a file in the system's temporary directory, and return the name of that.

sys_get_temp_dir():

Returns current temp folder of system.

PHP How to create temp file in temp Directory:

PHP Example:


// Create a temporary file in the temporary
// files directory using sys_get_temp_dir()
$temp_file = tempnam(sys_get_temp_dir(), 'Tux');

echo $temp_file;

output like C:\Windows\Temp\TuxA318.tmp


You can also use this free php scripts to your free php cms software developments .This is free php scripts.This free php scripts does not take any kind of responsibilities You can always use on your own risk.You can reports bug to me for this free php scripts.  

Buy Me a Beer-If you are like this post

 If you does not have paypal account create free account create account

No comments:

Post a Comment