Using a form inside a HTML such that the input is:
<input id="afile" type="file" accept="*.csv" name="afile">
And sent via javascript like:
$(function() {
$('#afile').change(onChange);
});
function onChange() {
var file = this.files[0];
var fd = new FormData();
fd.append("afile", file);
var xhr = new XMLHttpRequest();
xhr.open('POST', 'upload/handle_upload.php5', true);
xhr.send(fd);
}
I watch the request data in the Net panel of Firebug and Live HTTP headers but all data appears in plaintext (I am assuming that they are showing pre-encrpytion).
Is the file encrypted before transfer? If so, when does the file become encrypted?
If this is a HTTPS connection, it will be encrypted before leaving the browser. The Net Panel inside of the browser will probably show it decrypted for your convenience. If you used a network sniffer, you should be able to verify that the connection is secure.
The file per se is not encrypted, but the complete HTTP request is (and the file is in there).