Skip to content

Commit c5e89fb

Browse files
committed
rename button + cleanup
1 parent 1c1740f commit c5e89fb

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/MessageHandler/FileUploadMessageHandler.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ public function __construct(string $uploadDir,
2727

2828
public function __invoke(FileUploadMessage $message)
2929
{
30-
//echo 'File upload received: ' . $message->getId();
31-
32-
sleep(2);
30+
// Fake being busy - resizing is very fast.
31+
sleep(2); // 2 s
3332

3433
// fetch entity
3534
$entity = $this->repository->find($message->getId());
@@ -38,8 +37,6 @@ public function __invoke(FileUploadMessage $message)
3837
{
3938
$path = $this->uploadDir . '/' . $entity->getName();
4039

41-
//echo "Start resizing for: " . $path;
42-
4340
$this->resizer->resize($path);
4441

4542
// update status

templates/file_upload/index.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends 'base.html.twig' %}
22

3-
{% block title %}Q! image{% endblock %}
3+
{% block title %}Q! Image{% endblock %}
44

55
{% block body %}
66

@@ -52,7 +52,7 @@
5252
<input type="file" name="myfile" id="myfile">
5353
</div>
5454

55-
<button type="submit" class="btn btn-outline-primary btn-sm">Send</button>
55+
<button type="submit" class="btn btn-primary btn-sm">Upload</button>
5656

5757
</form>
5858

0 commit comments

Comments
 (0)