Welcome
Login
Sign up
Home
Solutions
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
JavaScript
publicly readable doesnt work
f
federik21
started a topic
over 6 years ago
I try to upload a pic, but when i log as another user i don't have the permissions.
I tried (AS IT IS WROTE DOWN THE GUIDES)
var promise = Kinvey.File.upload(
b64toBlob(imageData,"data:image/jpeg;base64,",false),
{
_id : window.localStorage.getItem("username"),
mimeType : 'image/jpeg',
size : imageData.length
},
{
public : true,
success: function(file) {
setImage();
},
error: function(response) {
alert('Server error, try again later.')
}
});
AND (as suggested HERE https://support.kinvey.com/discussion/201272194/uploading-a-public-readable-image-file) I TRIED SO:
Kinvey.File.upload(
b64toBlob(imageData,"data:image/jpeg;base64,",false),
{
_id : window.localStorage.getItem("username"),
mimeType : 'image/jpeg',
size : imageData.length
},
{public: true}
).then(function(file) {
console.log("caricata");
setImage();
});
SO I have 2 question:
1. Where do I mistake?
2. how to modify the _acl so I (hope) can solve all my problems setting all readable to everyone.
2 Comments
Oldest First
Popular
Newest First
Sorted by
Oldest First
M
Mark
said
over 6 years ago
You can set the `_acl` as follows:
```
Kinvey.File.upload(
b64toBlob(imageData, "data:image/jpeg;base64,", false), {
_id: window.localStorage.getItem("username"),
_acl: {
gr: true
},
mimeType: 'image/jpeg',
size: imageData.length
}, {
public: true
}
).then(function (file) {
console.log("caricata");
setImage();
});
```
f
federik21
said
over 6 years ago
now it works thanks
Login
or
Signup
to post a comment
More topics in
JavaScript
How do I use Kinvey in my web app?
Is it safe to include keys/secrets in my client-side JavaScript app?
Why is the activeUser null even though I am logged in?
Login does not work even though credentials are valid.
Social login doesn’t work.
Appending objects to an Array (HTML5 - JS)
New to node.js - need bootstrap to downloadfiles from Kinvey
Problem with Aggregation/Grouping
Internal Server Error using Twitter Sign Up
Data Store
See all 315 topics
federik21
I tried (AS IT IS WROTE DOWN THE GUIDES)
var promise = Kinvey.File.upload(
b64toBlob(imageData,"data:image/jpeg;base64,",false),
{
_id : window.localStorage.getItem("username"),
mimeType : 'image/jpeg',
size : imageData.length
},
{
public : true,
success: function(file) {
setImage();
},
error: function(response) {
alert('Server error, try again later.')
}
});
AND (as suggested HERE https://support.kinvey.com/discussion/201272194/uploading-a-public-readable-image-file) I TRIED SO:
Kinvey.File.upload(
b64toBlob(imageData,"data:image/jpeg;base64,",false),
{
_id : window.localStorage.getItem("username"),
mimeType : 'image/jpeg',
size : imageData.length
},
{public: true}
).then(function(file) {
console.log("caricata");
setImage();
});
SO I have 2 question:
1. Where do I mistake?
2. how to modify the _acl so I (hope) can solve all my problems setting all readable to everyone.