Upload file, then canceled input, but file already in DB

Upload file, then canceled input, but file already in DB

Loren MaxwellLoren Maxwell Posts: 387Questions: 94Answers: 10

For this example: https://editor.datatables.net/examples/advanced/upload.html

When a user uploads a file, an entry is made in the "files" table and the file is stored in the system directory.

If the user completes the remainder form and submits it then the remaining data is saved to the "users" table and all is well.

However if the user uploads the file and then cancels the edit, the record of the upload stays in the "files" table and the file itself stays in the system directory since nothing tells the server-side Editor to do anything.

Granted it should be cleaned up the next time the form is properly submitted (assuming dbClean is used), but is there something that's suppose to delete the record from the "files" table if the edit was canceled?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Answer ✓

    No. Because the cancellation is a client-side action, and there is nothing to tell the server that the edit has been cancelled, it doesn't know that the edit is no longer active. In the absence of that, the next dbClean will do the tidy up.

    Allan

  • Loren MaxwellLoren Maxwell Posts: 387Questions: 94Answers: 10

    Thanks, @allan -- just verifying my understanding is correct!

Sign In or Register to comment.