Is there a way for users not to be able to download a stored file and just preview it - firebase-storage

I am hosting some mp3 files for a website, the site showcases music for a producer. I need to be able to let the users listen to the music, but not be able to go to the firebase storage public location. Currently I have the music playing in an HTML, this obviously requires a source which the user can access and get the file download.
I've been using the getDownloadUrl() method, to get the source link but when you inspect you can see the link to the firebase storage file which will allow the user to download the file.
To let the user listen to the file without being able to download or go to the firebase storage link.

If you want to let someone listen to a mp3 stored in Cloud Storage, you effectively have to allow them to download it. There is no "listen only but no download" function. Cloud Storage also does not support any audio streaming protocols.

Related

How do you get the upload URL of a backend server so you can upload data to it?

I am trying to upload some data to firebase storage by using an upload URL instead of the traditional way by using:
Storage.storage().reference().child("Name").putFile("file name")
The reason that I need the URL instead of going the traditional route is because I need to use URLSession to upload data so my task can finish uploading in the background if the user closes out of the app during the upload time.
Summary:
How do you get the URL of my firebase storage so I can directly upload data through my URL using URLSession instead of using the traditional route?
Thanks in advance! Let me know if you have any questions.
There is no way to generate a signed upload URL through the Firebase SDKs for Cloud Storage.
If you want to upload using an upload URL, you'll have to generate the upload URL with one of the GCP SDKs or the REST API (all of which are designed to be used in trusted environments only), and share that with your clients (for example through the Firebase Realtime Database or Firestore, or a custom API endpoint you create in Cloud Functions/Cloud Run).

Can Google Assistant access audio on a web post

I want to allow my friend using Google Home to access audio posts on a WordPress blog. Can I make it treat my blog as a podcast without registering it with, say, iTunes?
I don't have a Google Home unit, and have not found detailed documentation on Google Assistant, except for writing actions. Is there a simpler way to do what I want without writing an action? Can I get my audio file and then access the existing code that handles operations within a file such as seeking, play, pause, etc. from my action?
You can take a look at content actions to generate a unique feed for your audio posts. In this way, you would be able to effectively create a podcast which can be surfaced by users on Google Homes as well in the Google Podcasts app. This would be a shallow integration.
If you want something more advanced and customized, you can create an Action and make use of the Media Response in Actions on Google.
Even if you don't have a Google Home, you are able to access your Action from other surfaces like a smartphone. You can also make use of the simulator in the Actions on Google console for development.

Allow broswer to download images from Google Cloud Storage?

I have a compute engine and google cloud storage work together.
The compute engine has a tomcat running allow browsers to load a page and get the images from the google cloud storage.
How could i allow the html page (generated by the servlet) to download several images from the google cloud storage where the images are not public shared??
What i expect is when the broswers downloaded the html page then it will request the images directly from the cloud storage, but how can i allow the broswer to do it without making the images public sharable?
Thanks
This is tricky but possible. If you want to manage some sort of authorization scheme for who can and cannot view GCS images, you'll need a service which can vend short-term, signed URLs to parties that your service decides are authorized. You then embed the URLs in the image tags of your dynamically-generated HTML pages, or you fetch the URLs from the server with JavaScript.
The gcloud-java library has a signURL method for generating such a URL.
Another option would be to simply obfuscate the image URLs to something unguessable and rotate them every so often.

Is there a way to upload the contents of a URL to Dropbox using their API?

I'm building a client/server video app. The video lives on the server, typically. If I want to allow app users to copy videos to their Dropbox, is there any way to do that using the Dropbox API on the app other than downloading the content to the app and re-uploading it to Dropbox? Reading their API, it seems like they only have file upload, not upload from a URL. Is there any way?
Is the Saver an option for you? That takes a URL and presents the user with UI to choose a location within Dropbox, after which the file will be saved to that location.
It's as simple as including a <script> tag and then adding class="dropbox-saver" to what would otherwise be a normal download hyperlink.
See https://www.dropbox.com/developers/dropins/saver.

How to get uploaded tracks from soundcloud?

I have implemented Sound cloud api in my app to export songs to soundcloud.
Now,I want to launch a browser in my app.This browser will allow the user to browse and listen to various other users songs that have been exported to SoundCloud through my app.
Also,the songlist should not include tracks which are not uploaded through my app.
The following is a screenshot from an app which uses similar functionality:
The only change in my app will be that I dont want the Sessions list.
Please suggest how to do this.
I am with an answer for my question. wat a relief.. :)
To get the app id first, the url is to be resolved by:
http://api.soundcloud.com/resolve?url=http://soundcloud.com/apps/{appName}
With this, you will get your app id.
(For more on Resolver, can refer to the link : https://github.com/soundcloud/api/wiki/12-Resolver)
Now, you can get tracks created with your app like this:
http://api.soundcloud.com/apps/{app-id}/tracks
For the browser look, it is to be customised on your own. Its not a standard from SoundCloud.