-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uppy: Import from URL is not working #1308
Comments
Is there any answer on above ? |
Any update on this ,I am facing similar issue? |
No update yet, sorry. It’s working for me locally, running standalone Companion. |
I am providing a sample project. |
In your example, you are not using any uploader plugins. You need to use an uploader like Tus or XHRUpload. Also there was a bug with Link provider that’s been fixed recently: #1390 (comment). |
Url fix is on npm, |
I have used the uppy "import from URL" service, but its showing me the upload button, but when I am clicking on that not happen anything. I'm also consoling that response: its showing the "Upload complete! We’ve uploaded these files" and in actual it will not uploaded in the folder. So please help me in this issue. Pleae find the following code.(Backend: nodejs)
<title>Uppy</title>Index.html
`<!doctype html>
server.js
`var express = require('express')
var bodyParser = require('body-parser')
var session = require('express-session')
var companion = require('@uppy/companion')
var path = require('path');
var app = express()
app.use(bodyParser.json())
app.use(session({secret: 'fgh45yspNak2FG7Al09ZxlPxwu482jvTgVpL'}))
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*')
res.setHeader(
'Access-Control-Allow-Methods',
'GET, POST, OPTIONS, PUT, PATCH, DELETE'
)
res.setHeader(
'Access-Control-Allow-Headers',
'Authorization, Origin, Content-Type, Accept'
)
res.setHeader('Access-Control-Allow-Credentials', 'true')
next()
})
app.get('/uppyservers', (req, res) => {
res.sendFile( __dirname + "/" + "index.html" );
});
// be sure to place this anywhere after app.use(bodyParser.json()) and app.use(session({...})
const options = {
providerOptions: {
google: {
key: 'GOOGLE_KEY',
secret: 'GOOGLE_SECRET'
}
},
server: {
host: 'localhost:3002',
protocol: 'http',
},
filePath: './uploads',
sendSelfEndpoint: "localhost:3002",
secret: 'yto937Bx82Dsl228NbXczQapljA13jdlwivn30KladNs',
}
app.use(companion.app(options));
app.use((req, res, next) => {
return res.status(404).json({ message: 'Not Found' })
})
// handle server errors
app.use((err, req, res, next) => {
console.error('\x1b[31m', err.stack, '\x1b[0m')
res.status(err.status || 500).json({ message: err.message, error: err })
});
companion.socket(app.listen(3002), options);
console.log('Welcome to Companion!')
console.log(
Listening on http://localhost:${3002}
)`The text was updated successfully, but these errors were encountered: