My users upload images that should be only view-able and handled by them self.
Let me describe what’s happening; I created my first user, uploaded an image successfully with this method:
Backendless.Files.Android.upload(image1_scaled, Bitmap.CompressFormat.PNG, 100, identifier+"image1"+profile, "images", new AsyncCallback<BackendlessFile>() {
@Override
public void handleResponse(BackendlessFile response) {
fileMapping.url_1 = response.getFileURL();
Backendless.Data.of(UserFileMapping.class).save(fileMapping, new AsyncCallback<UserFileMapping>() {
@Override
public void handleResponse(UserFileMapping response) {
toast_error("Image stored");
}
@Override
public void handleFault(BackendlessFault fault) {
System.out.println("ERROR" + fault.getCode());
}
});
}
@Override
public void handleFault(BackendlessFault fault) {
}
});
I then created a second user and logged in on that account, and the same image I uploaded from the first account shows up after iterating through the FileMapping table and downloading the image from the url it returns. So obviously I’ve managed the table’s permissions wrongly. I simply want that every image the currently logged in user uploads, can only he retrieve, edit and delete.
http://support.backendless.com/public/attachments/c3d770f47296ead68565290df0b25cb3.png</img>
http://support.backendless.com/public/attachments/76e01898b94da55310ee4fac5337661c.png</img>