Hi @ramin009,
When files are hosted externally it is not possible for EDD to restrict the files. The reason for this is simple: the files are not on the server that EDD is on and so it cannot hide them. All EDD can do is send customers to that file’s location to download it.
The only way to protect externally hosted files is to use a service like Amazon S3 that we integrate with through a developer API they offer to generate one-time, secure download links. See our extension for a good option: https://easydigitaldownloads.com/downloads/amazon-s3/
acctually, i live in god damn iran and like many services, we can not purchase services from other countries easily.
however, thank you for quick answer.
just 1 thing, i wonder woocommerce can do it some how, so im certain its possible. but as i realized, you just dont want it, right?
you know, many people prefer EDD for digital products. its easy ,simple and powerfull. if there was only 1 thing to make it in disaddventage , its that problem. i just wanna you know about this .
and i do continue with EDD, and try to bring my files in the host . good luck and thanks again.
I’ve looked into the source code for WooCommerce and they handle remote files the same way we do. Here’s the code that is used for remotely hosted files in WooCommerce:
/**
* Redirect to a file to start the download.
*
* @param string $file_path File path.
* @param string $filename File name.
*/
public static function download_file_redirect( $file_path, $filename = '' ) {
header( 'Location: ' . $file_path );
exit;
}
That code instructs the browser to redirect to the $file_path (the URL of the file). That’s the same behavior EDD uses.
It’s possible there’s an additional configuration for WooCommerce that handles remote files differently but I’m not seeing it. Do you happen to have that set up somewhere such that you could show me?
sure. i have made 2 free product with woo and EDD. you can see the results in this image :
http://bayanbox.ir/view/8545358913401746456/0001.png (please zoom on that)
main file url is:
http://bayanbox.ir/download/633644638131816808/5102.zip
and my site url is: ebook.gixx.ir
the address of file (that hosted in bayanbox.ir ) is accesable with EDD (after purchase). but not with woo.
you can test it personally by purchasing this file in address below:
http://ebook.gixx.ir/product/test-woo-prod/
http://ebook.gixx.ir/downloads/download-with-edd/