# Cannot upload a downloaded backup

**URL:** <https://meta.discourse.org/t/cannot-upload-a-downloaded-backup/50250>\
**Category:** Bug\
**Created:** [September 16, 2016, 4:57pm UTC](https://meta.discourse.org/t/cannot-upload-a-downloaded-backup/50250 "2016-09-16T16:57:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [September 16, 2016, 5:22pm UTC](https://meta.discourse.org/t/cannot-upload-a-downloaded-backup/50250/2 "2016-09-16T17:22:52Z")

</div>

I maybe wrong, but it may be related to this

> <https://github.com/discourse/discourse/blob/512922d7767c84615b8b77089e34ede244a88c7f/app/controllers/admin/backups_controller.rb#L122>

From this commit:  
[https://github.com/discourse/discourse/commit/512922d7767c84615b8b77089e34ede244a88c7f](https://github.com/discourse/discourse/commit/512922d7767c84615b8b77089e34ede244a88c7f)

And the fact that `-` may need to be escaped like `.` is. Alternatively, if you list `-` at the very end, it should work too but being between two characters, it thinks it is trying to define a range.

So either  
`/^[a-zA-Z0-9\.\-_]+$/` or `/^[a-zA-Z0-9\._-]+$/` should work

Thoughts @tgxworld?

Also, I think it would be better to make the test, use ‘test\_Site-0123456789.tar.gz’ so that it utilizes all of the characters you are permitting.

> <https://github.com/discourse/discourse/blob/512922d7767c84615b8b77089e34ede244a88c7f/spec/controllers/admin/backups_controller_spec.rb#L212>

---

_[View the full topic](https://meta.discourse.org/t/cannot-upload-a-downloaded-backup/50250)._
