fine-uploader
fine-uploader copied to clipboard
Using fineuploader S3 cross-device
Type of issue
- [ ] Bug report
- [x] Feature request
Uploader type
- [ ] Traditional
- [x] S3
- [ ] Azure
I'm creating a cross-device application. I'm using react-native web to build a web and native application sharing code.
I almost nailed it using the fine-uploader to upload a video to S3 using the fine-uploader library. But unfortunately I couldn't get it to work for native.
I got it to work in Reactjs using the basic uploader without the dropzone you provide, because of react-native doesn't use html and css. Here is my example:
import qq from 'fine-uploader/lib/core/s3'
let file = event.target.files[0]
let uploader = new qq.s3.FineUploaderBasic({
request: {
endpoint: 'endpoint',
accessKey: 'accessKey'
},
...
});
uploader.addFiles({name: file.name, blob: file});
Amazing how easy this was. i'm retrieving the file via a file input. On react native I use Expo ImagePicker.
The FineUploaderBasic is perfect, but it lives in the same file which uses code for the Element (which i don't need). This code contains document.createElement("input"), navigator.userAgent and probably more code which is not available in react-native. So when I import fine-uploader/lib/core/s3
I get errors like Can't find document
.
Is it possible that the FineUploaderBasic would live in it's own file? So you can import it separate like:
import FineUploaderBasic from 'fine-uploader/lib/core/s3/FineUploaderBasic'
import qq from 'fine-uploader/lib/core/s3'
let file = event.target.files[0]
let uploader = new qq.s3.FineUploaderBasic({
request: {
endpoint: 'endpoint',
accessKey: 'accessKey'
},
...
});
uploader.addFiles({name: file.name, blob: file});
fine-uploader/lib/core/s3
I get errors like Can't find document
.import FineUploaderBasic from 'fine-uploader/lib/core/s3/FineUploaderBasic'
Feature request details
react-native-web is really cool, sharing almost all your code over native and web. Probably more people would like to upload videos to S3 easily via the fineuploader library