I'm trying to implement a feature where a user clicks a link, then it would open a txt file and then it could be edited and saved inside the browser (similar to Google docs).
I've read this in hopes of finding a solution but it still doesn't work. The closest I've reached is to display the txt file in the browser:
<a href="test.txt">Click</a>
But this requires the file to be in the root folder of the website. When I try to put something like file:///SERVER/PATH/test.txt
, Chrome will respond with an error saying that 'local files can't be accesed'.
Is what I'm trying to do even feasible?
I see a [html] tag, so i will answer as a website developer.
Your case:
When you click a link by browser, as "test.txt" or "http://localhost/test.txt", or any link in any server, you want open file "test.txt".
We have a lot of thing need to attend:
Link test.txt is a link what is provided by server, and access by your browser to download, it's NOT a direct file. So you can't edit that file direct by your browser.
Sometime, you will open another tab in browser to edit as Google Docs. It's not simple as you see, "just open a editor". It's a website application, develop by some language as Javascript, HTML, CSS, PHP/ASP ...
If you want to "it could be edited and saved inside the browser", you must write a website application as Google Docs.
It's easy if you are website developer, but will hard if you are not.
If you specially want to edit and save file by using Google Doc, you can use Google App Script, you can read/write docx, xlsx from your website application with API.
If you want to read the data from excel file, then be able to edit and save it as well in the web application, by ASP server side code.
You need do some big work to do:
- read data from excel file.
- Display into your website application.
- Make a some input/text area/table or anything you want, to allow people can edit what they want.
- Save what people edited into your excel file (or database)
Try this link if you want to use pure ASP.
Try this link if you want to use library.
After try them, you can ask another question for more detail, when you know more.
This is a case similar to your case