Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6014727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:44:05+00:00 2026-05-23T02:44:05+00:00

Is it possible to store the uploaded file by move_uploaded_file to a directory and

  • 0

Is it possible to store the uploaded file by move_uploaded_file to a directory and mark it to be deleted after a few minutes? I’m trying to make a temporary file stay on the server after a period of time then it will get deleted (only if it’s not processed with) so when a file has been uploaded and moved to a directory if it has not been processed (don’t worry about this part, this will be done by me) it should delete the file from the server.

There is no way you can keep the temporary file on the server (without using move_uploaded_file) so basically stored in the tmp directory on the server how can I keep the file when uploaded into the temporary directory (or moved to a directory) and “mark” it to be deleted later on if not processed.

I’ve tried to research how this is possible, but I have not found any type of questions/topics about how to create a temporary file to stay after a limit of time.

EDIT: To clarify, I do not want the file deleted after the script has finished executing after upload.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:44:06+00:00Added an answer on May 23, 2026 at 2:44 am

    Follow these steps:

    First use the usual move_upload_file function and keep the file on your server.

    Now create a new php program to do this:

    1. use the filetime function to determine the last edited time of the file. Thus you can check if it was processed recently.
    2. Compare the date/time above with your deletion criteria.
    3. Use the php unlink function to get rid of the older files.

    Now run the above program as a cron once a day.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does it possible to execute php file and store its output into some variable?
I'd like to store uploaded files into a specific directory that depends on the
Possible Duplicate: Unique key generation How to automaticly make a new name of file
Is it possible to store a type name as a C++ variable? For example,
Is it possible to store erb templates in database? How?
Is it possible to store the credentials that I use to connect to my
It is possible to store blobs and arraybuffers in indexedDB (as you can see
Is it possible to store shell output into GDB variable in gdbinit? Something like:
I understand it is possible to store images in Databases as Binary large objects.
Sorry if this is a dumb question, but it is possible to store, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.