Coder Social home page Coder Social logo

Comments (9)

ktk avatar ktk commented on July 29, 2024

Issue fusepoolP3/p3-proxy#12 indeed fixed the execution, thanks!

However I noticed that it works in Chrome only, in there a csv file seems to set the correct Content-Type header text/csv and the filename stays as I would expect it.

In Firefox an upload of a file with a csv extension results in a filename.csv.bin file in the transformer and in the execution it sets:

batchrefine p3 08:09:12.723 [...BatchRefineTransformer] Content-Type:application/x-unknown (0ms)

Which will fail in BatchRefine as it's not a supported input-type.

from p3-dashboard.

ktk avatar ktk commented on July 29, 2024

Woops didn't want to close this sorry.

from p3-dashboard.

retog avatar retog commented on July 29, 2024

Ok, I tried post a cvs with firefox (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0) and the Content-Type is correctly "text/csv".

I don't think that the problem you experience is related to the dashboard. Could you please document in terms of curl request and create an issue against the proxy if you think this should somehow deal with browsers sending wrong content-type?

from p3-dashboard.

ktk avatar ktk commented on July 29, 2024

I've seen this effect with the p3-resource-gui as well today while demonstrating the platform. For reasons I don't understand Marco could not upload a JSON config to LDP without getting it renamed to .bin. It didn't matter if he was using Chrome or Firefox (on Windows). So I had a look at the headers and noticed that in his case no content-type field was sent with the .json file. In my case on Macos both Firefox and Chrome send Content-Type:application/json with the request and then everything is fine.

Can anyone reproduce that? I have no clue on what decision the browser either sends or does not send the content-type. And obviously if its missing LDP seems to handle it as binary.

from p3-dashboard.

retog avatar retog commented on July 29, 2024

@szluca would it be possible to do some guessing based on the file name extension if no Content-Type header is sent?

from p3-dashboard.

szluca avatar szluca commented on July 29, 2024

Do we know about any other file types that get sent without content-type?
I've built in a guessing mechanism, and added only ".json" -> "application/json" so far.

from p3-dashboard.

ktk avatar ktk commented on July 29, 2024

@szluca I think the best reference is https://www.iana.org/assignments/media-types/media-types.xhtml

from p3-dashboard.

retog avatar retog commented on July 29, 2024

@szluca it all depends on the configuartion of the client. Basicall if the content type is not set or application/octet-stream the app should do some guessing, but of course the list of extension the dashboard knows about can be much shorter than the typical /etc/mime.types file. I can think of the following extensions the dashboard should recognize: json, csv, ttl, n3, nt, rdf, turtle, xml

from p3-dashboard.

szluca avatar szluca commented on July 29, 2024

Okay, thank you.

from p3-dashboard.

Related Issues (19)

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.