Unable to upload file to S3 using @uppy/url
See original GitHub issueI’m using the Uppy react modal component.
import React, { Component } from 'react';
import Uppy, { UppyFile } from '@uppy/core';
import { DashboardModal } from '@uppy/react';
import Url from '@uppy/url';
import AwsS3Multipart from '@uppy/aws-s3-multipart';
export class FileUpload extends Component<Props> {
uppy: Uppy.Uppy;
constructor(props: Props) {
super(props);
this.uppy = Uppy({
id: 'MyUppy'
....
/* -- uppy config options -- */
}).use(Url, {
id: 'MyUrl',
companionUrl: process.env.REACT_APP_FILES_HOST
})
.use(AwsS3Multipart, {
id: 'AwsS3Multipart',
companionUrl: process.env.REACT_APP_FILES_HOST
});
}
componentWillUnmount() {
this.uppy.close();
}
onClose = () => {
this.uppy.reset();
}
render() {
return (
<DashboardModal
uppy={this.uppy}
plugins={['MyUrl']}
inline={false}
open={this.props.visible}
....
/* -- uppy config options -- */
/>
);
}
}
This is the TypeScript code I’m using. I’m basically trying to upload files to s3 using multipart plugin from url. I have correctly configured the Uppy companion instance
var express = require('express');
var cors = require('cors');
var bodyParser = require('body-parser');
var session = require('express-session');
var companion = require('@uppy/companion');
var app = express();
var corsOptions = {
origin: '*',
methods: "GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS",
optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
}
app.use(cors(corsOptions));
app.use(bodyParser.json());
app.use(session({
secret: 'UPPY_SECRET'
}));
var options = {
server: {
host: 'AWS_HOST.compute-1.amazonaws.com:8080',
protocol: 'http',
},
filePath: './uploads',
providerOptions: {
s3: {
getKey: (req, filename) => {
var date = (new Date()).getTime();
return date + '-' + filename;
},
key: 'AWS_KEY',
secret: 'ASW_SECRET',
bucket: 'ASW_BUCKET',
region: 'AWS_REGION'
}
}
};
try {
var server = app.listen(8080);
companion.socket(server, options);
app.options('*', cors(corsOptions));
app.use(companion.app(options));
} catch (error) {
console.log(error);
}
Am I missing something here? When I try to upload using URL, I see an OPTIONS call to /url/meta
followed by a POST call to /url/meta
which returns an object like
{"type":"image/png","size":13504}
After this nothing happens. I don’t see any other network activity after this. What am I missing here?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:11
Top Results From Across the Web
Resolve errors uploading data to or downloading data ... - AWS
First, follow the steps below to run the SELECT INTO OUTFILE S3 or LOAD DATA FROM S3 commands using Amazon Aurora. If you...
Read more >Unable to upload file to bucket due to network error
Hi, We are unable to upload a ~30 MB mp4 video file to a bucket. The upload fails at 0% again and again...
Read more >Import From URL - Uppy
The @uppy/url plugin allows users to import files from the internet. ... Companion will download the files and upload them to their destination....
Read more >Unable to upload file to S3 bucket - Stack Overflow
You have to use --recursive option to upload a folder: aws s3 cp --recursive “D:\WindowsImageBackup” s3://ad-backup/.
Read more >Unable to upload and download files from S3 storage
The time on the Storage Connector server is not synchronized with the S3 storage. Storage Connector verifies the uploads with a GET command,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m still experiencing this issue.
On Tue, Dec 17, 2019, 10:21 PM Artur Paikin notifications@github.com wrote:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.