fine-uploader-wrappers | ES6 classes that wrap a Fine Uploader S3 | File Upload library
kandi X-RAY | fine-uploader-wrappers Summary
kandi X-RAY | fine-uploader-wrappers Summary
These wrap a Fine Uploader instance as ES6 classes and provide additional features such as the ability to dynamically register multiple event/callback listeners. These classes are requirements in projects such as React Fine Uploader and Vue Fine Uploader, among others.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fine-uploader-wrappers
fine-uploader-wrappers Key Features
fine-uploader-wrappers Examples and Code Snippets
Community Discussions
Trending Discussions on fine-uploader-wrappers
QUESTION
I have autoUpload
set to false
, as I want to upload the images myself to my backend. However, to do this I first need the file object. In the callbacks onSubmitted
event I'm trying to pass the images id to the getFile
method, to return the object. However, when I try to do this I get the below error message.
in onSubmitted: id=0 | name=28603454_15219061700_r.jpg index.js:2178
[Fine Uploader 5.16.2] Caught exception in 'onSubmitted' callback - Cannot read property 'uploader' of null
I'm guessing I get this because I'm declaring a const object and referencing it at the same time, which I believe you cannot do...
So, any ideas on how I can call methods within the callbacks
function? Or is there another way?
ANSWER
Answered 2018-Sep-04 at 15:11this
is tricky in javascript. Within regular functions (e.g., function f(){...}
), this
depends on where the function is called rather than where it is defined. When using callbacks via a 3rd party api, you don't really have control over where it is called, so you can end up with errors like you have above.
Fortunately, you can use arrow functions (e.g., const f = () => {...};
) to bind this
based on where the function is defined.
See the MDN docs for more info or you can reference this excellent SO answer.
For your code in particular, however, I am not sure that either of those will work as your this
when you define onSubmitted
is just the global/window object.
In order for this to work, you need to create a closure at the top level (right before you actually create the uploader):
QUESTION
I've implemented FineUploader in my React app to upload files to my Azure Blob Storage and it's working fine except for one issue.
After uploading a file successfully, if I try uploading another one, FineUploader is not allowing me to select a new file. Clicking the select button opens up the dialog box to let me select a file but clicking the file to select it simply does nothing. I don't see any errors either.
Any idea what could be causing this issue?
Here's my implementation of FineUploader in my app:
...ANSWER
Answered 2018-Oct-09 at 14:01As explained in the comment the itemLimit: 1
option is limiting the total number of upload for that Uploader
to 1.
Since what you are trying to achieve is actually avoiding multiple upload at once you can use the option multiple: false
to block selection of multiple files.
Also, to avoid users adding more files while others are still uploading, you can use a custom validation where you check if some other files are in progress, for example:
QUESTION
In my stack I am using redux-token-auth to authenticate users with my rails backend (devise_token_auth). In my app I need to allow authenticated users to upload images, for this I'm using react-fine-uploader.
My problem is that I'm not seeing a way to have ract-fine-uploader
to POST the images in an authenticated way. and in general how to use redux-token-auth to upload data to my backend with authentication.
I found that redux-token-auth
stores authentication tokens in the localStorage
, so I'm kinda able to retrieve it and authenticate my requests. Though I don't like accessing such data directly with a localStorage.get("access-token")
(It's written by the package, it just seems fair to use the package to handle it).
Also with react-fine-uploader
the response object doesn't contain the headers from the server response, so I'm not sure on how to get the new tokens to store them.
Here's the code I got so far:
my ImagesUploader
:
ANSWER
Answered 2018-Apr-16 at 11:29From taking a look at redux-token-auth
, it expects to handle all auth calls and doesn't give you an escape hatch in the code - so yanking the localstorage seems like a prudent thing to do there. You can see in the code that it sets it for every request: https://github.com/kylecorbelli/redux-token-auth/blob/8c5a8fe573918d406a733ca1b21c0b4349f137ab/src/actions.ts#L160
As for fine-uploader
it looks like you can grab the rawheaders by using xhr.response
https://github.com/FineUploader/fine-uploader/blob/master/client/js/traditional/traditional.xhr.upload.handler.js#L59
The response
variable that you get back has been JSON parsed via the qq
variable you pass in: https://github.com/FineUploader/fine-uploader/blob/master/client/js/traditional/traditional.xhr.upload.handler.js#L109
QUESTION
I'm trying to include fine uploader in my react app using react fine uploader. I need my image dropzone to bind to my form, so that images will be sent to the backend when I press submit along other form data. (So that I can correctly assign any images to the right database item).
For some reason this is not happening, and fineuploader tries to POST the images right away.
this is my ImagesUploader
component:
ANSWER
Answered 2018-Mar-18 at 03:04React Fine Uploader uses the non-UI (core) version of Fine Uploader. This means all UI features native to Fine Uploader are absent, such as form support. If you want to submit files to Fine Uploader via your form, you'll need to do this the "react way". That involves passing an onSubmit
function prop to your
event.preventDefault()
to prevent the post to the server. Additionally, you'll need to send whatever form data is present to Fine Uploader using the addFiles
API method (for files) and setParams
for params. You can actually pass the non-file form data alongside the files by including those as a 2nd parameter (formatted as an object) to addFiles
.
I can actually see an additional component being added to React Fine Uploader, something like that handles all of this for you. But, alas, I have not created such a component yet.
QUESTION
I'm trying to implement FineUploader React library into my React app to upload files to my Azure Blob Storage.
Looks like for some reason, FineUploader is getting the blob storage URI wrong.
This is how I instanciate a FineUploader in my test component:
...ANSWER
Answered 2017-Dec-29 at 02:57I was able to make it work. Basically there're a few things that one need to keep in mind:
In your
FineUploader
config, you will needendpoint
attribute and that should have the URL of the blob container where you want to upload. This is how configuration looks like in my code:
QUESTION
I'm trying to use fineuploader with react and have installed all the relevant dependencies. Following is the code I use:-
...ANSWER
Answered 2017-Oct-03 at 09:56I think you have to import Gallery
component from module.
import Gallery from 'react-fine-uploader'
Update:
Also try wraping Gallery
inside a div
QUESTION
In Visual Studio, Gulp is not running to convert my scss
files to css
.
The error I'm getting is:
cmd.exe /c gulp --tasks-simple C:\Users\sam\Documents\Visual Studio 2017\Projects\MyProject\MyProject\node_modules\node-sass\lib\binding.js:15 throw new Error(errors.missingBinary()); ^ Error: Missing binding C:\Users\sam\Documents\Visual Studio 2017\Projects\MyProject\MyProject\node_modules\node-sass\vendor\win32-x64-47\binding.node Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 5.x Found bindings for the following environments: - Windows 64-bit with Node.js 7.x This usually happens because your environment has changed since running
npm install
. Runnpm rebuild node-sass
to build the binding for your current environment.
I did run npm rebuild node-sass
in the root of my project folder but still getting the same error. This is what I got after running npm rebuild node-sass
:
Binary found at C:\Users\sam\Documents\Visual Studio 2017\Projects\MyProject\MyProject\node_modules\node-sass\vendor\win32-x64-51\binding.node Testing binary Binary is fine node-sass@3.13.1 C:\Users\sam\Documents\Visual Studio 2017\Projects\MyProject\MyProject\node_modules\node-sass
My Gulpfile.js
looks like this:
ANSWER
Answered 2017-Sep-19 at 06:22cnpm install gulp-load-plugins --save-dev
QUESTION
Using React and FineUploader 5.14.2-rc1 in UI mode. Uploads work great, but the displayed thumbnails are inconsistent. When I click the component and select a file from the system file selection dialog, the file is represented by a thumbnail of the image. But when I drag the same file and drop it on the component, it displays a generic file icon rather than an image thumbnail. I'm assuming this is a configuration problem, but I can't find anything germane in the documentation. Here's the relevant component:
...ANSWER
Answered 2017-Jun-01 at 22:41I've encountered this myself, downgraded to react-fine-uploader 0.6.0 and all works again.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fine-uploader-wrappers
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page