 <p>You can create a <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob" rel="nofollow"><strong><em>Blob</em></strong></a> for this, but it won't be "saved" to the client's device. The <em>Blob</em> can then be submitted to the server using an <em>XMLHttpRequest</em></p> <pre><code>// bytes , mime var b = new Blob(['text data'], 'text/plain'); // make it easy to submit or just submit it directly var fd = new FormData(); fd.append('fileParam', b, 'file_name.txt'); // assuming XMLHttpRequest xhr xhr.send(fd); </code></pre> <p>If <em>FormData</em> is not available for the device, then you can send the blob directly. Adding a <em>FormData</em> makes the server side easier as it is the same as if you submitted a <code>&lt;form&gt;</code> with some <code>&lt;input&gt;</code>.</p>