The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> How to code HTML download button where filename version will change
larry78723
post Mar 15 2020, 08:26 AM
Post #1


Member
***

Group: Members
Posts: 39
Joined: 5-March 20
Member No.: 27,220



I'm creating a webpage where the user will be able to download an .iso file. The version of the iso will change. For example: xxxx.1.iso will become xxxx.2.iso when the iso is updated. How do I code the download button so that I don't need to re-code the button when the version changes. If I were to create a download subdirectory, and the .iso file was kept there do you think this would work if the only file in the download subdirectory is the .iso file?

<?php
$files = array_slice(scandir('/download/'), 2);
?>
<div class="navbar-custom">
<a class="btn-solid-lg page-scroll" href="/Download/" download=$files>Download the App</a>
</div>

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
larry78723   How to code HTML download button where filename version will change   Mar 15 2020, 08:26 AM
larry78723   I've tried the following method but it immedia...   Mar 15 2020, 04:51 PM
CharlesEF   Maybe I don't understand correctly, but I thin...   Mar 15 2020, 05:49 PM
CharlesEF   If you are using a web server you could use server...   Mar 15 2020, 06:10 PM
larry78723   If you are using a web server you could use serve...   Mar 15 2020, 06:15 PM
Christian J   If you are using a web server you could use serve...   Mar 15 2020, 06:58 PM
CharlesEF   What language are you using? I'll use PHP to ...   Mar 15 2020, 06:26 PM
larry78723   What language are you using? I'll use PHP to...   Mar 15 2020, 11:30 PM
CharlesEF   $files = glob('download/*.iso'); If y...   Mar 16 2020, 01:55 AM
Christian J   I still don't think a button will trigger a d...   Mar 16 2020, 05:38 AM
larry78723   True, an onclick event needs to be used with java...   Mar 16 2020, 06:25 AM
CharlesEF   Thanks to both of you. I guess my question becomes...   Mar 16 2020, 10:35 PM
larry78723   I didn't see this post before but here goes. ...   Mar 17 2020, 07:43 AM
Christian J   <a href="<?php echo "/{$file...   Mar 17 2020, 11:15 AM
larry78723   Does the web page have a .php file extension? Usu...   Mar 17 2020, 01:09 PM
Christian J   Regardless of what php file I try to open in any ...   Mar 17 2020, 06:58 PM
pandy   My thought also. Or the actual script changes the ...   Mar 17 2020, 08:32 PM
pandy   Oh, you run this on your local machine? You can us...   Mar 17 2020, 08:47 PM
larry78723   If you want to use a button then the onclick shou...   Mar 16 2020, 08:27 AM
Christian J   $files = array_slice(scandir('/downl...   Mar 15 2020, 07:05 PM
CharlesEF   Here is how it should be done, according to me. ...   Mar 15 2020, 08:42 PM
CharlesEF   Here is a sample of what you want to do. I've...   Mar 15 2020, 10:16 PM
larry78723   Would I be better off trying to use jquery to get ...   Mar 16 2020, 08:15 AM
CharlesEF   If you are a beginner then you must understand the...   Mar 16 2020, 09:20 AM
Christian J   I still think you can get this to work using an a...   Mar 16 2020, 12:34 PM
larry78723   [quote name='CharlesEF' post='138591' date='Mar 1...   Mar 16 2020, 07:00 PM
CharlesEF   In case you haven't read this before, PHP will...   Mar 17 2020, 11:52 AM
CharlesEF   How many browsers did you try it on? You should t...   Mar 17 2020, 02:47 PM
larry78723   How many browsers did you try it on? You should ...   Mar 17 2020, 04:32 PM
CharlesEF   Did you try my example code? Change the download ...   Mar 17 2020, 06:17 PM
larry78723   Thanks everyone. Got it working on the host server...   Mar 18 2020, 06:32 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 07:47 AM