Prompt user to save file to a specific location

早过忘川 提交于 2019-12-02 09:09:52

问题


I'm creating a website that generates a text file. I would like for the user to save the file to a specific folder (it's a backup file for a video game).

Is it possible to change the default folder the file is saved to via PHP or HTML? C#, while not my first pick, would also be acceptable.


回答1:


If I understand correctly, NO you cannot default to a location on the users computer. This is just a security piece that you cannot get around.

Try educating the user before they download. That's the best way.




回答2:


No file download locations are handle at the browser level




回答3:


You could probably package the text file in an installer / extractor that loads it to the location you want, but I don't think you want to go that far ^.^




回答4:


You cannot prompt the user to save the file to a specific place on his/her computer, you can however save some stuff on the users pc by the use of Web Storage, that is a part of the HTML5 spec. You will not be able to control where it will be saved though.

It would not be a smart move to store backups for your game on the users pc, as it would open a endless world of cheating and hacking.



来源:https://stackoverflow.com/questions/8405180/prompt-user-to-save-file-to-a-specific-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!