Javascript rename file on download

前端 未结 6 1977
粉色の甜心
粉色の甜心 2021-01-11 11:08

I want to be able to download a web file, but when the download dialog open, the filename is renamed.

Ex: File: http:////test.txt

6条回答
  •  星月不相逢
    2021-01-11 11:45

    If what you want is to return a continuous type of file name, you have to write a script that will keep track of that and provide that file back to the user. One way is using plain PHP, or something more advanced if it is several files at a time, possibly a cURL call in php so it can generate several different files. I am guessing that is what you are looking on doing, but you can't have the file name changed dynamically on the save box in that sense, you return the savename.txt filename.

提交回复
热议问题