-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Displaying Parse Images (AWS + Mongolab + Android) #415
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
Comments
Please post your Android code (preferably the part of upload and download of image). |
Sure. I'm having the problem when trying to download. The image upload wasn't tested yet. Here's the code to download:
The error occurs on currentUser.getParseFile("profile_image").getData(). Here's the error log:
|
It's because your data is probably empty. ParseFile profileImage= currentUser.getParseFile("profile_image");
profileImage.getDataInBackground(new GetDataCallback() {
public void done(byte[] data, ParseException e) {
if (e == null) {
// data has the bytes for the resume
Bitmap profile_image_bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
profileImageView.setImageBitmap(profile_image_bitmap);
} else {
// something went wrong
}
}
}); |
Ok, I've changed to that, but still the same error (below). This parse file exists, for instance if I only change the server endpoint back to parse ("https://api.parse.com/1/") everything works fine, this image is uploaded.
|
Yes, it makes sense. The error message suggests ACL permission error ("Forbidden"). (http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) How are you uploading the image ? |
Try to configure the file key as environment variable instead of server parameter: PARSE_SERVER_FILE_KEY |
After the migration I haven't uploaded any image. The images that exist were uploaded before the migration. Ok, here is the app.json configured with env variables, but still, the same error. I've also rechecked the keys, they're all right.
Here's the index.js
|
Thank you @Leo-One The problem is that aws wasn't properly deploying all changes to the running app. So now the images are showing just fine. But I still can't find a solution to why the current android authenticated user can't read/write records that have ACL read/write set to him. If anyone might know something, I've reported the issue here #414 |
Hey, ensure your Parse.com file key corresponds with that on your self-hosted server. |
Guys, i am running in the same problem. In my case, i deployed my app at Heroku by connecting to the Github repo (parse-server-example) from the Heroku website. So how can i access my Node code to do your suggestions ? |
I'm still having problems displaying parse images even after following all migration guide. Here's the error android is returning:
So here is what I have done so far:
Here is the configuration on index.js:
Appreciate any help. Thanks!
The text was updated successfully, but these errors were encountered: