0

There are some links on my site.

When these links are clicked, I serve the files with php.

When the download is finished, I delete the file and cancel the links.

If the user's browser opens the save as dialog window, the file starts downloading in the background.

The problem occurs here. If the user presses the cancel button in the save as dialog window and the file is currently downloaded in the background, the file is downloaded and deleted. However, the user does not actually download the file. The file goes to the tmp folder.

How can I serve the file after pressing the save button of the user here? Is there a way to handle the events of the buttons in the Save As dialog window?

I'll be happy if you can help me.

okanil
  • 1
  • Rather similar to this https://stackoverflow.com/a/12020217/5865284 – Matthew Spence Jul 16 '20 at 23:16
  • What do you mean by _“The file goes to the tmp folder”_? – CBroe Jul 17 '20 at 07:21
  • Even if the file finishes downloading in the background, if the user does not click the save button (or press the cancel button) in the save as dialog window, the file is not available to the user. If the user presses the save button, it is saved where the user wants to save the file. @CBroe – okanil Jul 17 '20 at 09:06
  • You say the file gets deleted, and then you say the file gets moved to the temp folder. You’re not making much sense here. And what you actually want, is also rather unclear. There are no “events” for this, this happens outside of the context of what you as a website author have access to. – CBroe Jul 17 '20 at 09:09

0 Answers0