当前位置: 动力学知识库 > 问答 > 编程问答 >

html5 - Search and replace using DOM and jquery

问题描述:

I am trying to make a webpage that allows the user to enter in the filepath of a .txt file and then search for and replace strings in the .txt file. I have done a bit of searching and only found pages saying it can't be done because of security reasons and im pretty sure this is rubbish.

How do i do it?

网友答案:

It's not rubbish. There is FileReader, but it's only supported by some browsers, and it only gives you read only access. Chrome evidently supports a FileWriter, but you can only write to a sandboxed environment.

You need to upload the file to a server, do the modifications, then send the modified file back -- note this won't get rid of the original.

分享给朋友:
您可能感兴趣的文章:
随机阅读: