[Drash](https://drash.land/drash/) is a framework for Deno's HTTP server. In a
`POST` request handler, the body parser can pull file data into a `Uint8Array`:
{`\
// @deno-types="https://cdn.sheetjs.com/xlsx-${current}/package/types/index.d.ts"
import * as XLSX from 'https://cdn.sheetjs.com/xlsx-${current}/package/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://cdn.sheetjs.com/xlsx-${current}/package/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
import * as Drash from "https://deno.land/x/drash@v2.5.4/mod.ts";
class SheetResource extends Drash.Resource {
public paths = ["/"];
public POST(request: Drash.Request, response: Drash.Response) {
// highlight-next-line
const file = request.bodyParam("file");
if (!file) throw new Error("File is required!");
// highlight-next-line
var wb = XLSX.read(file.content, {type: "buffer"});
var html = XLSX.utils.sheet_to_html(wb.Sheets[wb.SheetNames[0]]);
return response.html(html);
}
}
const server = new Drash.Server({ hostname: "", port: 7262, protocol: "http",
resources: [
// highlight-next-line
SheetResource,
],
});
server.run();`}
:::note
Deno must be run with the `--allow-net` flag to enable network requests:
```bash
$ deno run --allow-net test-server.ts
```
To test, submit a POST request to http://localhost:7262 including a file:
```bash
curl -X POST -F "file=@test.xlsx" http://localhost:7262/
```
:::