Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Android URIs with RNFetchBlob.wrap #628

Open
Noitidart opened this issue Dec 27, 2017 · 2 comments
Open

Android URIs with RNFetchBlob.wrap #628

Noitidart opened this issue Dec 27, 2017 · 2 comments

Comments

@Noitidart
Copy link

Hi there,

Thanks all for the amazing work on this lib. I had a question, I was doing an upload on Android, and was passing the uri (not path, its not available to me) direclty to RNFetchBlob.wrap and it was working. IE:

        const res = await RNFetchBlob.fetch(
            'POST',
            `......`,
            {
                Accept: 'application/vnd.api+json;VARIANT=ios',
            }, [{
                name: 'file',
                filename: 'dummy',
                type: mimeType,
                data: RNFetchBlob.wrap(uri), // uri is "content://com.android.providers.media.documents/document/image%3A89"
            }]
        )

This is working but I was hoping to get the actual "file name with extension". Is it posible to convert this URI to path?

Also is it expectd that RNFetchBlob.wrap should work with uri's?

@tombailey
Copy link

I have done some work related to this to support uploading files from content URIs; #546 .

Take a look at c7b9e2e you might be able to use that to get some information about the file extension.

@Uysim
Copy link

Uysim commented Mar 2, 2018

+1

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

No branches or pull requests

3 participants