Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:quasarframework/quasar into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Dec 16, 2022
2 parents 829bda6 + 7cd13d2 commit 257fa16
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/src/pages/vue-components/uploader.md
Expand Up @@ -324,6 +324,37 @@ end
isrunning(:webserver) || up()
```

### Perl/Mojolicious

```
# Perl
use Mojolicious::Lite -signatures;
# CORS
app->hook(after_dispatch => sub {
my $c = shift;
$c->res->headers->header('Access-Control-Allow-Origin' => '*');
});
options '*' => sub ($c) {
$c->res->headers->header('Access-Control-Allow-Methods' => 'GET, OPTIONS, POST, DELETE, PUT');
$c->res->headers->header('Access-Control-Allow-Headers' => 'Content-Type');
$c->render(text => '');
};
post '/upload' => sub ($c) {
my $uploads = $c->req->uploads('files');
foreach my $f (@{$uploads}) {
$f->move_to('/tmp/' . $f->filename);
}
$c->render(text => 'Saved!');
};
app->start;
```

## Supporting other services
QUploader currently supports uploading through the HTTP(S) protocol. But you can extend the component to support other services as well. Like Firebase for example. Here's how you can do it.

Expand Down

0 comments on commit 257fa16

Please sign in to comment.