formio / formio-upload Goto Github PK
View Code? Open in Web Editor NEWA file upload server/proxy for use with the Form.io file component.
License: MIT License
A file upload server/proxy for use with the Form.io file component.
License: MIT License
I'm attempting to get this setup with a self-hosted instance of formio and have some questions:
Does the private download option on the file field settings not exist anymore in the latest build or this a form.io hosted thing only?
How exactly does the authentication work and is this documented anywhere? Looking over auth.js it seems like the query params baseURL
and form
must be present but how that is used to perform the dummy upload isn't very clear to me. Starting the docker instance with this and pointing my forms file field to it returns the following in the console:
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router query : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router expressInit : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router corsMiddleware : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router dispatching POST /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router query : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router expressInit : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router corsMiddleware : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router jsonParser : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT body-parser:json content-type "multipart/form-data; boundary=----WebKitFormBoundaryCTUu1hNi6a9AvuL6"
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT body-parser:json skip parsing
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT express:router methodOverride : /file?baseUrl=https%3A%2F%2Fformio.stringercreative.co&project=&form=
formio-upload | 2019-07-31T17:56:30.271Z upload 7b6c750d-efa1-403a-b3d5-c779899f0124: New Request from https://formio.stringercreative.co/: (192.168.1.1)
formio-upload | 2019-07-31T17:56:30.272Z upload 7b6c750d-efa1-403a-b3d5-c779899f0124: Authenticating
formio-upload | Wed, 31 Jul 2019 17:56:30 GMT finalhandler default 500
formio-upload | Form not found.
I'm assuming there should be a form id # being sent in the URL but what mechanism drives that? Is this something in the forms configuration I'm missing? Adding the form ID to the query param form
and sending the request via Postman I can see in the docker console the container is receiving the request and attempting to authenticate but stops on "Authenticating" and never fails or succeeds.
Please provide as many details as you can:
To upload the file
Crash on the process
If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.
For code or form JSON, please enclose in a code block:
Full Debug report below
express:router:route post '/file' +1ms
express:router:layer new '/' +0ms
File Upload Proxy Listening on 4100
express:router dispatching OPTIONS /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +9s
express:router query : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +1ms
express:router expressInit : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +3ms
express:router corsMiddleware : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +0ms
express:router dispatching POST /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +14ms
express:router query : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +0ms
express:router expressInit : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +0ms
express:router corsMiddleware : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +1ms
express:router jsonParser : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +0ms
body-parser:json content-type "multipart/form-data; boundary=----WebKitFormBoundary68wCIkA2n3fCzaXW" +0ms
body-parser:json skip parsing +2ms
express:router methodOverride : /file?baseUrl=https%3A%2F%2Fdev-thess.pde.sch.gr%2Fformio&project=undefined&form=620b78c0df278801208dc5e4 +2ms
upload 298111ec-0749-40ae-bb32-328603304d0b: New Request from undefined: (::1) +0ms upload 298111ec-0749-40ae-bb32-328603304d0b: Authenticating +1ms
undefined:1
<!doctype html><html ng-app="formioApp"><head><meta charset="utf-8"><title>Form.io: The combined Form and API platform.</title><meta name="description" content=""><meta name="viewport" content="width=device-width"><link href="https://fonts.googleapis.com/css?family=Vast+Shadow" rel="stylesheet" type="text/css"><script src="https://maps.google.com/maps/api/js"></script><script src="//cdn.ckeditor.com/4.7.1/full/ckeditor.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ext-language_tools.js"></script><link rel="stylesheet" href="styles/app-86bcba9989.css"><link rel="stylesheet" href="styles/vendor-0ffa131bfe.css"></head><body><!--[if lt IE 10]>
^
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Request._callback (/mnt/d/git_projects/formioupload/middleware/auth.js:69:34)
at Request.self.callback (/mnt/d/git_projects/formioupload/node_modules/request/request.js:185:22)
at Request.emit (events.js:315:20)
at Request.<anonymous> (/mnt/d/git_projects/formioupload/node_modules/request/request.js:1154:10)
at Request.emit (events.js:315:20)
at IncomingMessage.<anonymous> (/mnt/d/git_projects/formioupload/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:421:28)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.