Error: Offsite media downloads are blocked

alt=
@andrusito
9 years ago
302 posts
Hello,

I have a problem to download mp3. I'm getting this error: Error: Offsite media downloads are blocked.
I've already set my 'Global Settings' to ALLOW_ALL_DOMAINS, ran an Integrity Check, but it doesn't solve the problem.

If you click this link: http://sermonescristianos.net/audio/download/audio_file/419/04-guerramp3 you will see the error.

What should I modify in order to download that mp3 without restrictions? I want to paste that url and get the mp3...

Thanks!
updated by @andrusito: 08/22/15 05:51:29AM
douglas
@douglas
9 years ago
2,793 posts
Is your ACP > Media > Audio Support > Global Config > Block File Downloads check box checked?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
michael
@michael
9 years ago
7,746 posts
You just need to link to it from your site, so if you put a link:
<a href="http://sermonescristianos.net/audio/download/audio_file/419/04-guerramp3">Download this</a>
anywhere on your site, it will be able to download.

Its to stop other sites from linking to your files pretending they are their own.
alt=
@andrusito
9 years ago
302 posts
@douglas No, it is not checked!

@michael I'm using the link in an Android app, that's why I want to make it downloadable from anywhere.. :(
michael
@michael
9 years ago
7,746 posts
Then you'll need to figure out what is set for
HTTP_REFERER

$_SERVER['HTTP_REFERER']
When the android app contacts your server and add that to the allowed domains.

Or use proxima
https://www.jamroom.net/proxima/

Or make a custom download function in a module (would be another way to do it).

--edit--
actually, it looks like ALLOW_ALL_DOMAINS should allow that through. hmmm.

Could you check the ALLOW_ALL_DOMAINS again please, it looks like it should be going through.
updated by @michael: 07/10/15 06:36:48PM
alt=
@andrusito
9 years ago
302 posts
Thanks michael,

Actually my app displays posts from a rss blog. That blog contains the link to the mp3 ( http://sermonescristianos.net/audio/download/audio_file/419/04-guerramp3)

That's why I'm using ALLOW_ALL_DOMAINS. I've also tried with that blog url..

This is how I set my JR panel: http://i.imgur.com/eJVEAo2.png

Thanks again.
michael
@michael
9 years ago
7,746 posts
It looks like the function fails if the $_SERVER['HTTP_REFERER'] is not set.

I've managed to get round it by setting it if its not set, in:
/data/config/config.php
if(!isset($_SERVER['HTTP_REFERER'])){
  $_SERVER['HTTP_REFERER'] = 'your-domain-here.com';
}
Along with ALLOW_ALL_DOMAINS allows it to work, but I'm wondering if its that secure for a reason. I'm surprised your application isn't sending the HTTP_REFERRER along, that would be the better way to handle it. This way works though.
alt=
@andrusito
9 years ago
302 posts
Michael,

This is my config file: http://i.imgur.com/mGvXYRr.png

Do I have to add that piece of code below that?

Thanks!!
alt=
@andrusito
9 years ago
302 posts
That worked Michael! Thanks!

Now, I think it is a problem or a bug or something..
What happens if I decide to upgrade the Jamroom core? Do I have to add that code everytime?
alt=
Ekwe
@ekwe
9 years ago
212 posts
I tried this and it is still not working. I am calling the site in a webview on my android app

michael:
It looks like the function fails if the $_SERVER['HTTP_REFERER'] is not set.

I've managed to get round it by setting it if its not set, in:
/data/config/config.php
if(!isset($_SERVER['HTTP_REFERER'])){
  $_SERVER['HTTP_REFERER'] = 'your-domain-here.com';
}
Along with ALLOW_ALL_DOMAINS allows it to work, but I'm wondering if its that secure for a reason. I'm surprised your application isn't sending the HTTP_REFERRER along, that would be the better way to handle it. This way works though.
michael
@michael
9 years ago
7,746 posts
andrusito:
That worked Michael! Thanks!

Now, I think it is a problem or a bug or something..
What happens if I decide to upgrade the Jamroom core? Do I have to add that code everytime?

No, your config.php file will never be touched by the update system.
michael
@michael
9 years ago
7,746 posts
Ekwe:....it is still not working....
Is not enough of an explanation to offer any advice on.
alt=
Ekwe
@ekwe
9 years ago
212 posts
I added the code,but now the links are not working. Nothing downloads after being clicked on
alt=
Ekwe
@ekwe
9 years ago
212 posts
This is how I have my code

<?php
$_conf['jrCore_db_host'] = 'ip';
$_conf['jrCore_db_port'] = 'port';
$_conf['jrCore_db_name'] = '******';
$_conf['jrCore_db_user'] = 'user';
$_conf['jrCore_db_pass'] = '*******';
$_conf['jrCore_base_url'] = 'domainname';

if(!isset($_SERVER['HTTP_REFERER'])){
  $_SERVER['HTTP_REFERER'] = 'domainname';
}
michael
@michael
9 years ago
7,746 posts
have you set my 'Global Settings' to ALLOW_ALL_DOMAINS?
alt=
Ekwe
@ekwe
9 years ago
212 posts
Yes, I have
michael
@michael
9 years ago
7,746 posts
Don't know then, sorry. That's all @andrusito and I have done to it working. Something must be different with your setup.

Tags