GithubHelp home page GithubHelp logo

Comments (7)

walkerblackwell avatar walkerblackwell commented on May 5, 2024

This problem has been persistent for a year or so. Master form.io does not work in default /file mode with formio_upload. Any reason why? I get exactly same 500 error response, form not found. formio_upload is broken and now abandoned? Is there some form config documentation missing in readme? Thank you in advance for your look at this.

from formio-upload.

travist avatar travist commented on May 5, 2024

We have many customers using this library, so it is hard to label this library as abandoned (going to create a new version now). That being said, all of our customers who use this library, use it with our Docker deployed servers, so I have not had a moment to debug if there are any issues with hosted Form.io. I have a hard time thinking that there is anything within this library that would keep it from working, but again, our main case for this library is to serve deployed customers to enable them to upload files to their own local file systems.

from formio-upload.

airarrazaval avatar airarrazaval commented on May 5, 2024

@lnorton89 @walkerblackwell What version of the Form.io JavaScritp SDK are you using? I have tested the latest version with both form.io enpoints and local deployment and is working without problems using formiojs@4.

Finally, regarding the private download option, this is not available in https://portal.form.io as it uses version 2.43.0. If using the form.io portal use the latest version available in https://next.form.io.

from formio-upload.

walkerblackwell avatar walkerblackwell commented on May 5, 2024

I'm using the FOSS formio (not formiojs) with docker locally. So I'm right in assuming this will only work with formio-js? I will experiment. Needs to be updated in the readme. Thank you.

from formio-upload.

walkerblackwell avatar walkerblackwell commented on May 5, 2024

Ok. So even using hosted js from https://formio.github.io/formio.js/ and local http://localhost:4100/file as the url and adding the name of the form and then scraping the json from the form but using lastest formio.js at https://unpkg.com/formiojs@latest/dist/formio.full.min.js does not work. Errors are the same:

Upload Proxy Listening on 4100
express:router dispatching OPTIONS /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +8s
express:router query : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +2ms
express:router expressInit : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +2ms
express:router corsMiddleware : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +0ms
express:router dispatching POST /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +10ms
express:router query : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +1ms
express:router expressInit : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +0ms
express:router corsMiddleware : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +0ms
express:router jsonParser : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +0ms
body-parser:json content-type "multipart/form-data; boundary=----WebKitFormBoundarygYmKB2rB5Qpk8UzQ" +0ms
body-parser:json skip parsing +8ms
express:router methodOverride : /file?baseUrl=http%3A%2F%2Flocalhost%3A3001&project=&form= +8ms
upload 6e3efd2d-782b-44b4-8ba7-53b8d9d15cfe: New Request from undefined: (::1) +0ms
upload 6e3efd2d-782b-44b4-8ba7-53b8d9d15cfe: Authenticating +0ms
finalhandler default 500 +0ms
Form not found.

Basically form= is not being filled properly even though the form name is defined in the json.

A writeup or validation of exactly how the /file portion is implemented locally would be ideal. Are there needing to be configs set in formio-upload for endpoint folders (tmp dir, form dir?) there is NOTHING about this in doc.

Thank you again,
Walker

from formio-upload.

walkerblackwell avatar walkerblackwell commented on May 5, 2024

Forgive me. I'm somewhat new to this platform but not entirely new to web development. This is aggravating to say the least both for me and probably for those who have implemented this properly and know the secret single button click to get it working.

It seems to boil down to authentication and permissions. With formio-upload running standalone (Docker or Node) it simply does not allow authentication with /file and/or is not passing the form= data. As far as I can see there is NO methods for sending these fields to the formio-upload instance. This is the case for full-fledged hosted formio as well as standalone formio on Docker. Another note, there is no longer an option in formio upload file component for "private download." Maybe that is what is causing no credentials for form name to pass to formio-upload. Regardless, this simply does not work as documented. Following the steps provided in formio-upload readme doc after successfully implementing every other part of formio (locally or hosted, premium and non) simply does not work to upload locally at http://localhost:4100/file. Am I missing something here? Is there some secret formula that everyone knows but nobody wants to document? Am I wrong in assuming that the /file protocol implemented in by formio-upload is the file handling service itself or does this simply need to pass the post request to another service like nginx upload? BTW, I tested this on most recent commits from 18 days ago or so . . . . this is entirely frustrating. Formio is the leading form management platform online today. Uploads are critical to that but as documented it does not work.

Steps for replication of this failure:

  1. Download formio github master and install and then run in Docker (docker-compose up) for formio/mongo install.
  2. Set permissions to be very forgivable. Anon for all permissions just to get rid of those variables. it does not matter though, the problem persists regardless.
  3. Create a form with upload field function set to URL at http://localhost:4100/file
  4. Define upload directory. (This is ? not documented as required but let's just go with it. Tested both ways doesn't work anyway). Set upload dir to /tmp on the formio-upload Docker and tmp on the form upload field. But not setting these also has same issue.
  5. Hunt for "private download" option it does not exist any longer. No explanation why.
  6. Download and run formio-upload. It does not matter which way but fine we can use Docker with default docker env settings defined in documentation. Run at http://localhost:4100. For better error reporting run in node with npm install and node index.
  7. Test form submission for jpg file upload. "Form not found." error. This error comes from auth.js file so it's authentication related. Form name is not passed to formio-upload from formio docker instance. Removing "Form not found" code changes response to "unauthenticated"
  8. Ok, now might as well test with formiojs 4+ and just scrape the json. Same problem.
  9. Ok test with premium trial. Scrape the json from that. Same problem.
  10. Test with Ubuntu VPS docker formio-upload instance. Same problem.

So how to pass credentials to formio-upload?

What is wrong?

thank you for your time,
Walker

from formio-upload.

walkerblackwell avatar walkerblackwell commented on May 5, 2024

Ok, so now that form.io has upgraded their main platform things are working ok now. There are still many bugs with https and XML headers but these can be worked out. Related to the FOSS solution (where there is no authentication because there is no project ID or functionality) I have put up a very hacky version of an unauthenticated file uploader. Docker is not working yet. I recommend using a .sh daemon to run it and not PM2 because PM2 has restart/log problems and also XML header problems with HTTP2. Solution is here (not trying to be secure yet just trying to be semi-functional for people who want a simple barebones working file upload system). Ideally formio-upload would allow you to toggle authentication and CORS on or off in the future. That would make work below moot. I recommend password protecting any GET requests for the file because there is not authentication/security. A note about the "real" authentication system, it does not allow download of files via action emails. The authentication is not sent through those emails but with a non-authenticated password protected system like I've set up (nginx htpasswd) you CAN send the email notifications and as long as someone knows the user/pass they can download the file. https://github.com/walkerblackwell/formio-upload-unauthenticated

from formio-upload.

Related Issues (2)

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.