> For the complete documentation index, see [llms.txt](https://goslide-framework.gitbook.io/slide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://goslide-framework.gitbook.io/slide/files.md).

# Files

Slide supports wide range of files support

## Static files <a href="#static-files" id="static-files"></a>

```go
// path and dir name
app.ServerDir("/static", "static")
```

## Serve Single file <a href="#serve-single-file" id="serve-single-file"></a>

```go
// single file
app.ServeFile("/js", "static/login.js")
```

## Send Attachment <a href="#send-attachment" id="send-attachment"></a>

```go
// Downloading file
app.Get("/download", func(ctx *slide.Ctx) error {
	return ctx.SendAttachment("static/login.js", "login.js")
})
```

## Uploading files <a href="#uploading-files" id="uploading-files"></a>

```go
// uploading file
app.Post("/upload", func(ctx *slide.Ctx) error {
	return ctx.UploadFile("static/login.js", "login.js")
})
```

### Serve file from route <a href="#serve-file-from-route" id="serve-file-from-route"></a>

```go
app.Get("/servefile", func(ctx *slide.Ctx) error {
   return ctx.ServeFile("static/index.html")
})
```
