react-firebase-file-uploader
react-firebase-file-uploader copied to clipboard
Fixed error getting name from metadata after upload
var name = storageRef.child(filenameToUse).getMetadata().then(function (metadata) { return metadata.name; });
I fixed with: task.snapshot.ref.name
has been working well so far...
This is amazing !
Is this going to be merged into master?
merge please
Is this going to be merged into master?
Well, pull request is still there.
merge please
You can use this
npm i https://github.com/qnxdev/react-firebase-file-uploader/tarball/master
merge please
You can use this
npm i https://github.com/qnxdev/react-firebase-file-uploader/tarball/master
i'm using [email protected] and your fix for uploader and i'm having error
my 'filenameToUse' = '3267094a-6d54-495c-b093-57d2aa482947.png' and .split('/') from firebase is can't be used there because 'childPath' is not array correct me if i'm wrong
function from firebase
function child(path, childPath) { var canonicalChildPath = childPath .split('/') .filter(function (component) { return component.length > 0; }) .join('/'); if (path.length === 0) { return canonicalChildPath; } else { return path + '/' + canonicalChildPath; } }
merge please
You can use this npm i https://github.com/qnxdev/react-firebase-file-uploader/tarball/master
i'm using [email protected] and your fix for uploader and i'm having error
my 'filenameToUse' = '3267094a-6d54-495c-b093-57d2aa482947.png' and .split('/') from firebase is can't be used there because 'childPath' is not array correct me if i'm wrong
function from firebase
function child(path, childPath) { var canonicalChildPath = childPath .split('/') .filter(function (component) { return component.length > 0; }) .join('/'); if (path.length === 0) { return canonicalChildPath; } else { return path + '/' + canonicalChildPath; } }
I had the same problem and realize that filename
argument is not resolved promise while .child(filename)
is fired.
Try:
const handleUploadSuccess = async (filename) => { const name = await filename; setImage(name); setUploadProgress(100); setIsUploading(false); storage .ref() .child(name) .getDownloadURL() .then((url) => setImageURL(url)); };
I fixed with:
task.snapshot.ref.name
has been working well so far...
this working for me
task.on('state_changed', function (snapshot) {
return onProgress && onProgress(Math.round(100 * snapshot.bytesTransferred / snapshot.totalBytes), task);
}, function (error) {
return onUploadError && onUploadError(error, task);
}, function () {
return storageRef.child(filenameToUse).getMetadata().then(function (metadata) {
//return metadata.name;
_this2.removeTask(task);
return onUploadSuccess && onUploadSuccess(metadata.name, task);
});
});
Is there any version of this lib working with the latest version of Firebase? I keep trying to fork this library and implement some of the fixes mentioned here and elsewhere and hitting weird bugs. Please help.
For example, when I implement @marvintechdoo's solution, I get an error on the second line of the fix telling me that onProgress is undefined. And of course it is defined in my tag, and even if it was not, the onProgress &&
part of the code should protect against that.
@sarbogast you can check my fork, i'm fixed it for myself https://github.com/alexneo2003/react-firebase-file-uploader
@alexneo2003 Thanks a lot. It's the this.props.
I was missing. Amazing.