Skip to content

Commit

Permalink
rename button + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
makomweb committed Jun 17, 2021
1 parent 1c1740f commit c5e89fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/MessageHandler/FileUploadMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public function __construct(string $uploadDir,

public function __invoke(FileUploadMessage $message)
{
//echo 'File upload received: ' . $message->getId();

sleep(2);
// Fake being busy - resizing is very fast.
sleep(2); // 2 s

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

//echo "Start resizing for: " . $path;

$this->resizer->resize($path);

// update status
Expand Down
4 changes: 2 additions & 2 deletions templates/file_upload/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html.twig' %}

{% block title %}Q! image{% endblock %}
{% block title %}Q! Image{% endblock %}

{% block body %}

Expand Down Expand Up @@ -52,7 +52,7 @@
<input type="file" name="myfile" id="myfile">
</div>

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

</form>

Expand Down

0 comments on commit c5e89fb

Please sign in to comment.