I'm trying on a Happstack-build website to read out "user submitted" plain text files. The main functionallity should be to get the file content, for further usage a server side storage of the file isn't needed.
This solution (using jQuery) was found, which is only HTML 5 supported:
$("#uploadbutton").change(function() {
var reader = new FileReader();
reader.onloadend = function() {
$("#output").val(reader.result);
}
reader.readAsText(this.files[0]);
});
The textfile content (selected via "#uploadbutton") is read out and shown in "#output". No Happstack file upload was needed.