Quickblox CONTENT versus CUSTOM OBJECTS files - quickblox

With QB release 1.8 it is now possible to upload files to classes in Custom Objects module.
Is there any performance differences between Custom Objects and Content? Can I just use
Custom Objects to upload all files in my app?
In Custom Objects module I can have meta information associated with each uploaded file like visibility (public/private), status (approved, rejected), etc, which I can't in Content module.

Here are features of each storage:
Content
no file size limit, up to 5TB
allows to use file public url
Custom Objects
max 32Mb file size
no public urls to files
great CustomObjects API like filters, permissions etc

Related

Is it possible sanity asset make private?

Sanity team said "Asset files are not private, so even images uploaded to a private dataset can be viewed by unauthenticated users."
(https://www.sanity.io/docs/keeping-your-data-safe)
The material on my site is only viewable by those who pay a monthly fee.
The material is mainly a pdf file.
Uploading a pdf file with type="file" creates an asset url.
Anyone can view it by typing the path into a web browser.
In the case of Vimeo, videos are played only when accessing from a specific domain.
Similarly, is it possible to make sanity assets available only within a specific domain?
I am in a similar situation and have done some resarch. It seems like private assets can't exist on Sanity. I believe the main reason is that every asset under 10MB in size will be cached on a CDN which does not have the authentication logic required to protect the assets.
IMO they should provide a toggle to make certain assets private, with the disclaimer that it will not be cached on a CDN.
Read more about Sanity CDN: https://www.sanity.io/docs/asset-cdn
EDIT:
You can however use a custom asset source, but it doesn't really sovle the problem: https://www.sanity.io/docs/custom-asset-sources

In ASP.NET Core MVC, how do you make uploaded images accessible to logged users in app but not to general public?

I have image upload in my system. I am struggling to understand what is the logic of serving images.
If I upload directly to wwwroot, the files will be accessible to everyone, which is not what I want.
I understand I could save the file contents in the database as base64 but those can be big files, and I would like them on the server in files.
I could convert them on the fly when requested. Most probably getting the path to file, then loading it in a memory stream and spitting out the base64. But seems overkill, and not an elegant solution. I use Automapper for most data and I have to write some crazy custom mappers, which I will If there is no other way.
I could create virtual path, which from what I understand maps physical path on server to a url which doesn't seem any different than option 1
I fancy there is a way to spit out a link/url that this user has access to (or at least logged users) that can be passed to the app so it can load it. Is this impossible or unreasonable? Or am I missing something?
What is the correct way of doing in general?
Also, what is a quick way to do it without spending days for setup?
To protect the specific static files, you can try the solutions explained in this official doc.
Solution A: Store static files you want to authorize outside of wwwroot, and call UseStaticFiles to specify a path and other StaticFileOptions after calling UseAuthorization, then set the fallback authorization policy.
Solution B: Store static files you want to authorize outside of wwwroot, and serve it via a controller action method to which authorization is applied and return a FileResult object.

Maintain Product Image URL in Moqui

Our product-specific images are at CDN and we want to store the image URL.
I found that we can do it in ProductContent with image type [PcntImageUrlOriginal]. Do we have an existing service?
You can use the inbuilt crud service:
create#mantle.product.ProductContent and set the contentLocation to a url I guess
The following is not an option as it receives the contents of the file as well as the extension but down below uses the inbuilt crud service.
mantle.product.ProductServices.create#ProductContent
declared in mantle-usl/service/mantle/product/ProductServices.xml

Dropbox v2 web service to retrieve children of a folder is not returning "size" metadata for folders

I am integrating Dropbox in my application. I am able to retrieve child folders of a folder in Dropbox using "https://api.dropboxapi.com/2/files/list_folder" web service. But the data that is being returned doesn't contain size data for folders. Is there any way to retrieve size data for folders in Dropbox?
No, the Dropbox API doesn't report the size of a folder. You would need to compute it yourself, presumably by using /list_folder (with "recursive": true). I'm assuming the definition you have in mind is "the sum of the sizes of all files contained within the folder, recursively."

Is is possible to set per file custom metadata in dropbox

I want to be able to set custom metadata on a file in dropbox. Ideally a string of at least 32 bytes for each file. I've looked through the core API docs but I haven't seen a way.
However I'm new to Dropbox so maybe I missed something or there is another way?
Thanks!
There isn't any way to set additional metadata on the file for your app. You could use the Datastore API (https://www.dropbox.com/developers/datastore) to store the string and the associated file path.