# Broken-Pipe-Fehler beim Hochladen zu einem S3-Klon: eine PDF-Datei mit einem Namen, der é, ï etc. enthält

**URL:** https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414
**Category:** Bug
**Created:** [20. Juni 2020 um 06:20 UTC](https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414 "2020-06-20T06:20:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [20. Juni 2020 um 06:20 UTC](https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414/1 "2020-06-20T06:20:22Z")

</div>

Neueste App, die ich vor einer Stunde neu erstellt habe. Ich kann das Problem auf Meta nicht reproduzieren; ich gehe davon aus, dass es mit der französischen Lokalisierung zusammenhängt.

Ich erhalte einen „Broken Pipe“-Fehler, wenn ich versuche, eine PDF namens la **ï** cit **é**.pdf hochzuladen, aber dieselbe Datei mit dem Namen laicite.pdf funktioniert problemlos.  
laïcité. **jpg** funktioniert ebenfalls einwandfrei.

Eine Datei namens d **é** croissance.pdf löst einen anderen Fehler aus: „Es ist ein interner Fehler aufgetreten. Bitte versuchen Sie es erneut.“ 🤨

P.S.: Ich bin mir nicht sicher, ob es relevant ist, aber ich verwende auch einen S3-Klon (Scaleway), der mir ebenfalls einen „Broken Pipe“-Fehler meldete, als ich rake uploads.migrate\_to\_s3 ausgeführt habe. Das scheint jedoch nicht zusammenzuhängen.

PPS: Ja, es könnte mit dem Upload über den S3-Klon zusammenhängen. Ich habe überprüft, dass ich einen vor drei Wochen durchgeführten Upload mit einem Akzent habe, kurz bevor die Option zum S3-Upload aktiviert wurde 🙄

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [20. Juni 2020 um 12:13 UTC](https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414/2 "2020-06-20T12:13:24Z")

</div>

Zeile 62 von [discourse/lib/file\_store/s3\_store.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/lib/file_store/s3_store.rb)

```
options[:content_disposition] = "attachment; filename=\"#{filename}\""

```

Die Content-Disposition sollte möglicherweise so formatiert werden:

```
options[:content_disposition] = ActionDispatch::Http::ContentDisposition.format(
        disposition: "attachment", filename: upload.filename
      )

```

wie in

> <https://github.com/discourse/discourse/commit/24877a7b8c3aa445f0969b298ba8a34ac57c7bd6>
>
> Backport of fix from Rails 6: https://github.com/rails/rails/commit/890485cfce4c…361c03a41ec23b0ba187007818cc

Falls ja, vielleicht auch diese content\_disposition-Werte:

> <https://github.com/discourse/discourse/commit/e5da2d24e543c86868768de235b8eedab1ee6ee1>
>
> This will make it so the original filename is used when downloading all non-imag…e files, bringing S3Store into line with the to\_s3 migration and local storage. Video and audio files will still stream correctly in HTML players as well.
> 
> See https://meta.discourse.org/t/cannot-download-non-image-media-files-original-filenames-lost-when-uploaded-to-s3/152797 for a lot of extra context.

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [22. Juni 2020 um 03:24 UTC](https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414/4 "2020-06-22T03:24:01Z")

</div>

Ich denke, du hast recht, solche Probleme mit Dateinamen entgehen mir immer. Ich sollte morgen in der Lage sein, einen PR hochzuladen, um das zu beheben. Danke für den Bericht!

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [23. Juni 2020 um 06:21 UTC](https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414/6 "2020-06-23T06:21:19Z")

</div>

> [@Benjamin\_D](#):
>
> d **é** croissance.pdf

Ich habe hier eine Korrektur für den Build vorbereitet, die bald übernommen wird. Ich habe sie mit dem oben genannten PDF-Dateinamen getestet, und alles funktioniert einwandfrei 👌. Die Korrektur wird bald übernommen!

> <https://github.com/discourse/discourse/pull/10108>
>
> See https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-…a-pdf-with-a-name-containing-e-i-etc/155414
> 
> \* When setting content-disposition for attachment, use the ContentDisposition class to format it. This handles filenames with weird characters and localization (accented characters) correctly.

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [26. Juni 2020 um 05:28 UTC](https://meta.discourse.org/t/broken-pipe-error-when-uploading-to-a-s3-clone-a-pdf-with-a-name-containing-e-i-etc/155414/7 "2020-06-26T05:28:22Z")

</div>


