Skip to content

Change asset upload to use data rather than file #66

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

Merged
merged 1 commit into from
Oct 15, 2016
Merged

Change asset upload to use data rather than file #66

merged 1 commit into from
Oct 15, 2016

Conversation

chrisbianca
Copy link
Contributor

So unfortunately, it seems that the security permissions for real devices are different from the simulator. Having installed my asset change PR to an actual device this morning, it turns out that trying to upload gives a permission denied error, despite having CameraRoll permissions.

To work around this, I have changed the upload method to use putData instead of putFile and have loaded the data using the Photo library rather than relying on Firebase to resolve the filename to the data (which is where the permissions error occurred).

Sorry for not testing thoroughly enough on the first pull request, but I hadn't expected the simulator to be so different from a real device.

@auser
Copy link
Contributor

auser commented Oct 11, 2016

Thanks for the follow-up PR. I'll try to get this in tonight.

@auser auser merged commit 58e7338 into fullstackreact:master Oct 15, 2016
@seantempesta
Copy link

Is this related to this error I'm getting?

Exception '[<NSError 0x6000004444a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.' was thrown while invoking uploadFile on target FirestackStorage with params (
    "<null>",
    "test.jpg",
    "Users/sean/Library/Developer/CoreSimulator/Devices/5E11E987-C50A-40\U2026BCA-C0F2BAC1280C/Documents/images/442C4A2E-E3D1-487B-9712-1C485982F21E.jpg",
        {
        contentEncoding = base64;
        contentType = "image/jpeg";
    },
    315
)

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