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

CB-11699 Read files as Data URLs properly #191

Merged
merged 1 commit into from Aug 22, 2016

Conversation

vladimir-kotikov
Copy link
Member

Platforms affected

Android, iOS, Windows

What does this PR do?

This PR fixes reading files as data URLs by modifying chunk size, so concatenated chunks would be a valid Data URL

What testing has been done on this change?

Ran plugin tests on all affected platforms

Checklist

  • ICLA has been signed and submitted to secretary@apache.org.
  • Reported an issue in the JIRA database
  • Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
  • Added automated test coverage as appropriate for this change.

When reading file as Data URL, CHUNK_SIZE must be divisible by 3, otherwise the resultant string, made by concatenating chunks, will not be a valid Base64 encoded Data URL. Also Windows do not support reading sliced files as data URLs, so we need to set chunk size equal to file size.

Relevant JIRA issues: CB-11699, CB-11199

When reading file as Data URL, CHUNK_SIZE must be divisible by 3,
otherwise the resultant string made by concatenating chunks will
not be a valid Base64 encoded Data URL.

Also Windows do not support reading sliced files as data URLs, so we
set chunk size equal to file size
@cordova-qa
Copy link

Cordova CI Build has completed successfully.

Commit - Link
Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Link Link Link

@vladimir-kotikov
Copy link
Member Author

@daserge, @sgrebnov, please take a look

/cc @jasongin

@dylanvdmerwe
Copy link

dylanvdmerwe commented Aug 22, 2016

Please do review this as the function in the current release does not work for files over a very small size.

@asfgit asfgit merged commit 3bc4945 into apache:master Aug 22, 2016
@vladimir-kotikov vladimir-kotikov deleted the CB-11699 branch August 22, 2016 08:55
@Samaludheen
Copy link

can we expect a fix for this soon?

@vladimir-kotikov
Copy link
Member Author

@Samaludheen, the fix has been released recently. Check out cordova-plugin-file@4.3.0

@beatgrabe
Copy link

@vladimir-kotikov Thank you a lot, your PR fixed exactly an issue I was facing today!

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.

None yet

6 participants