Jump to content

Recommended Posts

Ok I need to be able to create a temporary file in the same way that php creates a temporary file when uploading files. When a file is uploaded, php will store a temporary file at /home/username/tmp (and can be referenced by $_FILES["upload_name"]["tmp_name"]). Then via php you can use move_uploaded_files to move the temporary files to another location on the server. If the user does not move the file from the tmp directory and the php script finishes or if the move_uploaded_files function fails, php will automatically delete the temporary file.

 

Can this sort of functionality be re-created. I'm looked into tempnam and tmpfile, but neither will accomplish the automatic deleting.

 

Or can someone offer an alternative?

By default, the session id cookie has a zero session.cookie_lifetime setting and the cookie expires when all open browser windows/tabs are closed. session garbage collection will then automatically remove the session data files that are older then the session.gc_maxlifetime setting.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.