Giter Club home page Giter Club logo

Comments (17)

pieroit avatar pieroit commented on May 18, 2024 1

@calebgcc should be here:
https://github.com/pieroit/cheshire-cat/blob/main/frontend/src/services/rabbitHole.ts#L28

from core.

pieroit avatar pieroit commented on May 18, 2024 1

@calebgcc and here:
https://github.com/pieroit/cheshire-cat/blob/main/frontend/src/components/MessageInput/MessageInput.tsx#L115

from core.

pieroit avatar pieroit commented on May 18, 2024 1

@calebgcc just tested and .md works fine; I guess you are asking MIME type on the temp binary file?

from core.

pieroit avatar pieroit commented on May 18, 2024 1

@calebgcc I'll check on it

from core.

pieroit avatar pieroit commented on May 18, 2024 1

@calebgcc can confirm file.content_type == "text/markdown"
I'm on ubuntu

Screenshot from 2023-04-12 21-13-41

from core.

antonioru avatar antonioru commented on May 18, 2024

Yeah, we need to change the accept="text/plain, application/pdf" attribute to the Input field, is as easy as that...
I'm happy to address it unless @calebgcc you want to do it :)

from core.

calebgcc avatar calebgcc commented on May 18, 2024

I'm happy to address it unless @calebgcc you want to do it :)

@antinioru I can work on it on Friday, so if you can solve it before it's all your 😬

from core.

pieroit avatar pieroit commented on May 18, 2024

I inserted text/markdown as accepted MIME type in the frontend (backend already supports it).
I don't know if it is a linux only problem, but the .md files are not visible:

Screenshot from 2023-04-05 22-07-49

Unless I change the lower-right select to "All files". The upload goes smoothly after that.

Screenshot from 2023-04-05 22-07-56

If this is a linux only issue, we can close it

from core.

calebgcc avatar calebgcc commented on May 18, 2024

I'm doing some experiments, it's really odd how it behaves 😅.
With the new commit still .md files are not default uploadable, I have to change from "custom files" to "all files" exactly like @pieroit to select markdown files.

The problem then is with the backend, I added a log to upload.py to print the content_type of the uploaded file:
Screenshot 2023-04-07 alle 10 34 52
I'm exploring some solutions, let you all know

from core.

pieroit avatar pieroit commented on May 18, 2024

@calebgcc does it then upload the file anyway? Or does it break?
When I tested it was fine (this kind of test upload should be also in the test suite)
.
.
(when there will be a test suite XD)

from core.

calebgcc avatar calebgcc commented on May 18, 2024

@pieroit It breaks because application/octet-stream is not in the list of permitted content_types
It returns a response with status code 422

from core.

pieroit avatar pieroit commented on May 18, 2024

from core.

calebgcc avatar calebgcc commented on May 18, 2024

@pieroit Yes that could be a solution, tomorrow morning I'll test it

from core.

calebgcc avatar calebgcc commented on May 18, 2024

@pieroit it's strange I made several tries this morning and it didn't work :(
Every time I was getting the same error (is the one that you see in the screenshot above)
I'll test it again in the evening and I'll let you know

from core.

calebgcc avatar calebgcc commented on May 18, 2024

@pieroit Yep, the same problem.
Screenshot 2023-04-07 alle 22 07 52

I'm sure that for you the mime type is different, this is the only way this can work for you because the check is really strict, it allows only "text/plain" "text/markdown" and "application/pdf"

When you do the upload the mime type logged in the console is "text/markdown"?
Could be a mac os problem (?)

from core.

calebgcc avatar calebgcc commented on May 18, 2024

That's really strange, I'll investigate on that tomorrow

from core.

calebgcc avatar calebgcc commented on May 18, 2024

PR #114 solved this issue.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.