Skip to content

Conversation

@liubaishui
Copy link

liubaishui and others added 4 commits September 11, 2020 10:46
When a video is downloaded from Firebase Storage, it's filename has "/" encoded as "%2F", and as a result, we need to use Uri.parse two times, to get the actual file name instead of the full Cloud Storage path.
Fix the parser for the downloaded file
var req = await _client.get(fileUri);
var fileName = fileUri.pathSegments.last;
while (Uri.parse(fileName).pathSegments.length > 1) {
fileName = Uri.parse(fileName).pathSegments.last;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simpler way might be the following:

var filename = basename(fileUri.path);

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

Successfully merging this pull request may close these issues.

3 participants