As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Hi, I am trying to upload Files to Kinvey that are globally readable. Here is the code I use:
let fileStore = FileStore.getInstance()
let file = File()
file.publicAccessible = true
file.acl?.globalRead.value = true
fileStore.upload(file, data: imageData) { file, error in
if let file = file, let fileId = file.fileId {
//success
} else {
print("help")
}
}
I am using the Kinvey iOS SDK 3.3.8.
My file uploads correctly, but when I look in the data browser, the value for "_acl" is always only { creator : "creator_value_id" }. If I manually change the "_acl" in the data browser to include "gr:true", then my file becomes globally readable like I want it to be.
Is there any way for me to set the globalRead value in code, so that the file will be globally readable when it is saved in the DB?
Thanks
Best Answer
B
Billy Gee
said
almost 6 years ago
Hello Nick,
We believe that if you tweak your code as follows, this should work as intended.
Instead of doing the code in the following block...
file.acl?.globalRead.value = true
...you should code it as follows.
let acl = Acl()
acl.globalRead.value = true
file.acl = acl
Nick
Hi, I am trying to upload Files to Kinvey that are globally readable. Here is the code I use:
I am using the Kinvey iOS SDK 3.3.8.
My file uploads correctly, but when I look in the data browser, the value for "_acl" is always only { creator : "creator_value_id" }. If I manually change the "_acl" in the data browser to include "gr:true", then my file becomes globally readable like I want it to be.
Is there any way for me to set the globalRead value in code, so that the file will be globally readable when it is saved in the DB?
Thanks
Hello Nick,
We believe that if you tweak your code as follows, this should work as intended.
Instead of doing the code in the following block...
file.acl?.globalRead.value = true
...you should code it as follows.
let acl = Acl() acl.globalRead.value = true file.acl = acl
Or..
file.acl = Acl() file.acl?.globalRead.value = true
Please one of these alternatives a try and let us know if it moves you past this problem.
Regards,
Billy Gee
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPranav J
I have started looking into it and will get back to you once I have more information.
Thanks,
Pranav
Kinvey
Pranav J
I am able to reproduce this issue and this has been escalated to engineering. Will get back to you once I have more information on this.
Thanks,
Pranav
Kinvey
MLIBZ-1728
Billy Gee
Hello Nick,
We believe that if you tweak your code as follows, this should work as intended.
Instead of doing the code in the following block...
file.acl?.globalRead.value = true
...you should code it as follows.
let acl = Acl() acl.globalRead.value = true file.acl = acl
Or..
file.acl = Acl() file.acl?.globalRead.value = true
Please one of these alternatives a try and let us know if it moves you past this problem.
Regards,
Billy Gee
Nick
That worked, thanks!
Billy Gee
Hello Nick,
We're glad to hear it and thanks for confirming.
Regards,
Billy Gee
-
Why do I get "Undefined symbols" errors when building with KinveyKit?
-
How do I register push tokens?
-
When using social login, to perform a log-out, do I need to log out of the social network, Kinvey, o
-
How can I assign additional properties to users?
-
Does KinveyKit support 64-bit ARM devices, such as iPhone 5s?
-
Authorization Token Invalid or Expired
-
BOOL and how it is stored in the database.
-
Offline saving throwing errors
-
Custom endpoint not able to form request object
-
Security through business logic
See all 437 topics