SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
807 stars 171 forks source link

Unicode & file upload in restheart 3.0.1 #198

Closed 564008975 closed 7 years ago

564008975 commented 7 years ago

Hi!

I've found some troubles when using restheart 3.0.0 and 3.0.1.

  1. Unicode characters are not displayed correctly in restheart 3.0.1.

unicode

  1. File upload problem in both 3.0.0 and 3.0.1:
    • 'filename' field always be 'file'.
    • 'contentType' field always be null. I've tried to use curl with properties but have no change.

fileupload

Are these bugs or i have to change something in configuration file?

Thanks!

ujibang commented 7 years ago

Hi @khanhdhv

as you can see, the contentType is actually in metedata.contentType. at the time we wrote that feature the mongodb java driver did not allow to give the file contentType a value so we put it there. I'll check if the new version allows it.

the filename file is just the default value given when no filename property is specified. to pass it do as follows (I'm using httpie here):

http -f PUT 127.0.0.1:8080/testdb/mybucket.files/mypicture.png file@"~/Desktop/mypicture.png" properties='{"filename":"mypicture.png"}'

as you can see the properties part is a json object with filename property

ujibang commented 7 years ago

added bug to our backlog, see https://softinstigate.atlassian.net/browse/RH-241

564008975 commented 7 years ago

Thank you!

I have found the way to post file to the bucket. But there is a small problem when the file name have unicode characters. :D

filename

ujibang commented 7 years ago

thanks

took note in the jira bug. we will fix it...

ujibang commented 7 years ago

Please check this issue https://github.com/SoftInstigate/restheart/issues/206

It shows you how to fix the encoding problem you experienced

ujibang commented 7 years ago

closing for now, feel free to reopen if #206 doesn't work for you