Skip to content
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

Closed
vipuls8131 opened this issue Feb 21, 2019 · 6 comments
Closed

Uppy: Import from URL is not working #1308

vipuls8131 opened this issue Feb 21, 2019 · 6 comments
Labels
Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3)

Comments

@vipuls8131
Copy link

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)
Index.html
`<!doctype html>

<title>Uppy</title>
<script src="https://transloadit.edgly.net/releases/uppy/v0.30.0/dist/uppy.min.js"></script>
<script>
  var uppy = Uppy.Core()
    .use(Uppy.Dashboard, {
      inline: true,
      target: '#drag-drop-area'
    })
    .use(Uppy.Url, {target:Uppy.Dashboard, serverUrl: "http://localhost:3002"})

  uppy.on('complete', (result) => {
      
    console.log('Upload complete! We’ve uploaded these files:', result.successful)
  }).upload().then((result) => {
    console.log(result);
    })
</script>
`

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})`

@arturi arturi added the Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3) label Feb 22, 2019
@vipuls8131
Copy link
Author

Is there any answer on above ?

@KhalilMohammad
Copy link

Any update on this ,I am facing similar issue?
Google drive, Drobbox are working through companion but remote url is not

@arturi
Copy link
Contributor

arturi commented Mar 18, 2019

No update yet, sorry. It’s working for me locally, running standalone Companion.

@KhalilMohammad
Copy link

I am providing a sample project.
It must be something silly on my side.

@arturi
Copy link
Contributor

arturi commented Mar 30, 2019

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).

@arturi arturi added Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3) and removed Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3) labels Mar 30, 2019
@arturi
Copy link
Contributor

arturi commented Apr 5, 2019

Url fix is on npm, [email protected].

@arturi arturi closed this as completed Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3)
Projects
None yet
Development

No branches or pull requests

3 participants