jmc92 Posted March 11, 2011 Share Posted March 11, 2011 Is there a way of file browsing to a random txt file on my comp, and having its content loaded into a form on a web page?Further explaining the question....Theres a page with a large text formButton underneath says click to edit txt from fileAnd then I click, open and load the content into the form Link to comment Share on other sites More sharing options...
justsomeguy Posted March 11, 2011 Share Posted March 11, 2011 This isn't really a Javascript question, but you can have an upload form where after the form gets submitted it reads the file and shows the contents on the page. Link to comment Share on other sites More sharing options...
jeffman Posted March 11, 2011 Share Posted March 11, 2011 You can use AJAX to grab plain text from any text file on your server. No server-side scripting is required.Browsing is trickier and does require server-side action. Building a file browser from scratch is not for the faint of heart. Been there, and it was a great learning experience. There are also tools available. KFM is pretty common, and free. Google ajax file browser for others.An in-between technique would be to use just enough server-side scripting to embed a list of file URLs into your document. A user clicks on a name, and AJAX does the rest. Assuming your directory/file structure is orderly, this is not hard to do. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.