# Private Message Attachment Issue

**URL:** <https://meta.discourse.org/t/private-message-attachment-issue/29447>\
**Category:** Bug\
**Created:** [30. Mai 2015 um 10:12 UTC](https://meta.discourse.org/t/private-message-attachment-issue/29447 "2015-05-30T10:12:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![adundovi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adundovi/32/42645_2.png) [@adundovi](https://meta.discourse.org/u/adundovi)\
**Post date:** [31. Mai 2015 um 10:25 UTC](https://meta.discourse.org/t/private-message-attachment-issue/29447/4 "2015-05-31T10:25:08Z")

</div>

I can confirm this. Every new upload on my installation is affected after rebuilding container 10 hours ago.

I suppose that the problem is in a new path “/uploads/default/original/ **2X** /…/hash”? Where is this 2X coming from? I had done “rake uploads:migrate\_to\_new\_pattern” but it didn’t help.

EDIT: OK, I see from the routes.rb there is a new upload pattern (dir1/dir2) where every uploaded file is moved (`/var/www/discourse/config/routes.rb`):

```
get "uploads/:site/original/:dir1/:dir2/:sha.:extension"

```

Files do exist locally (/shared/uploads/default/original/2X) but Discourse is not routing it right.

EDIT2: I’ve temporarily fixed it by changing the route constraints `dir1: /[a-z0-9]/` to `dir1: /[a-zA-Z0-9]+/`:

```
get "uploads/:site/original/:dir1/:dir2/:sha.:extension" => "uploads#show", constraints: { site: /\w+/, dir1: /[a-zA-Z0-9]+/, dir2: /[a-f0-9]/, sha: /[a-f0-9]{40}/, extension: /\w{2,}/ }

```

because “X2” cannot be matched with the default regexp setting. Hope to see the official fix soon 😉

---

_[View the full topic](https://meta.discourse.org/t/private-message-attachment-issue/29447)._
