0

I create a custom plugin with a upload file input in the admin area, my concern is, what happens to the file after upload?

My concern is that the file that is going to be uploaded has sensitive information that I want to store to database in custom option(just making it more easy for my client to just drag and drop the file).

The process that I see is that the file is stored in the /tmp/ folder (stil not sure where it is located), then I get access to the file with $_FILES["input_name"]["tmp_name"] and manage it, but...what happens to the file? is it deleted, do I have to manually delete it.

I ask because it's a security issue that I am worried about, not sure if these temporary files can be access by third party.

PS: The /tmp/ folder is not created by me, when I debug I check the $_FILE and I see inside this array a key value ($_FILE['tmp_name'])with the name "/tmp/php7DjaSfE" and this is how I access the content of the uploaded file

4
  • 1
    If you've created the plugin then you would be entirely in control of what happens to the files - just naming a folder /tmp/ won't cause anything to happen automatically, you'll have to write the code to trigger a behaviour. Commented Feb 8 at 14:22
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Feb 8 at 14:22
  • @TonyDjukic thanks,also I did not create the folder /tmp/ , when I debug the code I see that $_FILE is automatically created and inside I see that there is a folder called /tmp/php7DjaSfE Commented Feb 14 at 11:33
  • Then you'll need to show the code - something is generating that folder. This is your custom plugin right? Commented Feb 14 at 15:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.