[Skip to main content](#vessel-content)

#   Shortcut to the file in a protected folder

##

- **[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")**
- [![neo191987's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35364.jpg)](/forum/user/35364-neo191987 "View neo191987's Profile") Topic Author
- [ Offline](/forum/user/35364-neo191987)

Less More

- Posts: 431
- Thank you received: 19
-
-

7 years 6 months ago -  7 years 6 months ago [\#305661](#305661) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  *[Shortcut to the file in a protected folder](/forum/2-general-talk-about-hikashop/897291-shortcut-to-the-file-in-a-protected-folder#305661 "-- HikaShop version -- : 4.0.3  Hi, I want to add support to audio player but I come across this problem. My goal after purchasing a product can be to create a playlist from which you can download and listen. The problem is that you need to create a shortcut to the file you should look like this:")* was created by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")*

-- HikaShop version -- : 4.0.3

Hi, I want to add support to audio player but I come across this problem. My goal after purchasing a product can be to create a playlist from which you can download and listen. The problem is that you need to create a shortcut to the file you should look like this: Code:

"name": "Song Name 1", "artist": "Artist Name", "album": "Album Name", "url": "/song/url.mp3", - problem "cover_art_url": "/cover/art/url.jpg"

Last edit: 7 years 6 months ago by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg5NzI5MS1zaG9ydGN1dC10by10aGUtZmlsZS1pbi1hLXByb3RlY3RlZC1mb2xkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

7 years 6 months ago [\#305664](#305664) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Shortcut to the file in a protected folder](/forum/2-general-talk-about-hikashop/897291-shortcut-to-the-file-in-a-protected-folder#305664 "-- HikaShop version -- : 4.0.3  Hi, I want to add support to audio player but I come across this problem. My goal after purchasing a product can be to create a playlist from which you can download and listen. The problem is that you need to create a shortcut to the file you should look like this:")*

Hi,

You can't use the direct URL to the file as the folder is protected.
So you have two options:
- you remove the protection on the upload safe folder (which means that as long as someone has the download link, it can get the file)
- you use the link that is given to the customer for the download of the file. In that case, the URL is different for each order. So I'm not sure if you have a way to have such dynamic URL with your audio player ? It might require some custom development in the audio player.

The following user(s) said Thank You: [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg5NzI5MS1zaG9ydGN1dC10by10aGUtZmlsZS1pbi1hLXByb3RlY3RlZC1mb2xkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")**
- [![neo191987's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35364.jpg)](/forum/user/35364-neo191987 "View neo191987's Profile") Topic Author
- [ Offline](/forum/user/35364-neo191987)

Less More

- Posts: 431
- Thank you received: 19
-
-

7 years 6 months ago -  7 years 6 months ago [\#305707](#305707) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  Replied by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")* on topic *[Shortcut to the file in a protected folder](/forum/2-general-talk-about-hikashop/897291-shortcut-to-the-file-in-a-protected-folder#305707 "-- HikaShop version -- : 4.0.3  Hi, I want to add support to audio player but I come across this problem. My goal after purchasing a product can be to create a playlist from which you can download and listen. The problem is that you need to create a shortcut to the file you should look like this:")*

I managed to get him to start free songs, which is good with this code, now comes the problem that I have to set a link for bought songs. Can some help also want to show if the product is not bought notice (This should show the product page). Also, I want to ask if I create a subscription whether after purchase there may be access to certain product files.

This code automatically generates url addresses: Code:

&lt;?php foreach($this-&gt;element-&gt;files as $file) { $json = array( "name" =&gt; $file-&gt;file_name, "artist" =&gt; '', "album" =&gt; '', "url" =&gt; hikashop_completeLink('product&amp;task=download&amp;file_id=' . $file-&gt;file_id.$url_itemid), "cover_art_url" =&gt; '' ); $info = json_encode($json); echo $info; echo ','; } ?&gt;

Last edit: 7 years 6 months ago by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg5NzI5MS1zaG9ydGN1dC10by10aGUtZmlsZS1pbi1hLXByb3RlY3RlZC1mb2xkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

7 years 6 months ago [\#305709](#305709) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Shortcut to the file in a protected folder](/forum/2-general-talk-about-hikashop/897291-shortcut-to-the-file-in-a-protected-folder#305709 "-- HikaShop version -- : 4.0.3  Hi, I want to add support to audio player but I come across this problem. My goal after purchasing a product can be to create a playlist from which you can download and listen. The problem is that you need to create a shortcut to the file you should look like this:")*

Hi,

1. If you want to add a message on the product page when the product has downloadable files available after the purchase, you would have to run a MySQL query on the hikashop_file table with a condition on the column file_free_download equal to 0 and a condition on file_ref_id equal to the product_id and a condition on the file_type equal to "file" to get the files of the product and then display the message if you have some results.

2. If you want to give access to downloadable files after the purchase of a subscription product, you can add these downloadable files in the plan settings.

The following user(s) said Thank You: [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg5NzI5MS1zaG9ydGN1dC10by10aGUtZmlsZS1pbi1hLXByb3RlY3RlZC1mb2xkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.050 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
