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

file download from application is 0B result #8274

Open
Abdullah2100 opened this issue Oct 20, 2024 · 2 comments
Open

file download from application is 0B result #8274

Abdullah2100 opened this issue Oct 20, 2024 · 2 comments

Comments

@Abdullah2100
Copy link

i am using mattermost v2.19.2 but i faced problem when i try to install image using the app it download okay ,but when when i try to install document i got result with 0B .the @mattermost/react-native-network-client version is 1.7.2

@amyblais
Copy link
Member

@Abdullah2100 Would you be able to help share more details such as your OS and version, Mattermost server version, and reproduction steps?

@Abdullah2100
Copy link
Author

Abdullah2100 commented Oct 26, 2024

Saving images and videos using "@react-native-camera-roll/camera-roll" works great, but saving files is not working. Here’s the code from Mattermost React Native:

import RNUtils from '@mattermost/rnutils';

    const saveFile = async (path: string) => {
        if (mounted.current) {
            if (Platform.OS === 'android') {
                try {
   /* this function not working   =>*/    await RNUtils.saveFile(path);
                } catch {
                    // do nothing in case the user decides not to save the file
                }
                setAction('none');
                return;
            }

            updateLocalFilePath(serverUrl, item.id, path);

            Share.open({
                url: pathWithPrefix('file://', path),
                saveToFiles: true,
            }).catch(() => {
                // do nothing
            });

            setAction('none');
        }
    };

I’m using Android 13.

react-native-cli: 2.0.1
react-native: 0.74.5
mattermost-v2.19.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants