0

This is my HTML table

<!DOCTYPE html>
<html>
<head>

</head>
<body>

<h2>HTML Table</h2>

<table>
  <tr>
    <th>File Name</th>
    <th>File Link</th>

  </tr>
  <tr>
    <td>Screen</td>
    <td>https://s3-ap-southeast-2.amazonaws.com/kvntest1/screen.jpg</td>

  </tr>

</table>

</body>
</html>

It has two columns.

One column contains the name of the file.

And the other column contains the actual link of the file.

When the user clicks on the link, the file will be automatically downloaded to their machine.

I am just curious to know whether it will be possible in jQuery to intercept this event and allow the user to rename the file (before downloading) ...kinda like event.preventdefault but on file download event ?

VPY
  • 463
  • 8
  • 21

1 Answers1

0

The download filename is part of the http response header. It cannot be changed from the client side. Only server can change it during the response.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

http download file name

Jigar Patel
  • 4,585
  • 1
  • 17
  • 20