rmachielse / ember-data-paperclip

Ember Data Paperclip
https://rmachielse.github.com/ember-data-paperclip
MIT License
7 stars 2 forks source link

Filename is always "data" in DB #5

Open Kotoriii opened 6 years ago

Kotoriii commented 6 years ago

Hey there!

Great add-on! However, when I save a document (docx or pdf) that goes to my Ruby on Rails Backend + DB (with the help of Paperclip), no matter what, the file name will ALWAYS be data. So, when I download the file, it is always unformatted. I always need to manually add the extension (say, data.docx) to the file for it to open in the proper program. Any idea on why this is happening? I tried customizing the filename in the model, but it will still always save as filename data.

Cheers

rmachielse commented 6 years ago

Hi @Kotoriii

You're right about that, as the file is currently serialized to base64 the file name is lost. Although it might be possible to replace "data" with the filename in the update function, but I haven't tried that yet.