Download file with dropdown






















Collectives on Stack Overflow. Learn more. Asked 5 years, 7 months ago. Active 5 years, 7 months ago. Viewed 1k times. Ashish Ahuja 4, 10 10 gold badges 49 49 silver badges 64 64 bronze badges. This seems over-complicated. It would remove the need for any javascript as well. Add a comment. Active Oldest Votes. Please let me know if it works for you. Eshu Eshu 1 1 silver badge 8 8 bronze badges.

Thank you Eshu, it did address passing the filename to JavaScript. How to trigger a file download when. Welcome to GeeksforGeeks. Download Image. By clicking the download button. Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments. What's New. Chrome and Firefox seem to be fine.

I am not finding any solutions… do you have ideas? Everything worked great with the drop down selector! Is there something else I should do or try? Simple use a-Elements linking to the files the user may download and style the a-Elements looking like buttons using CSS. Thanks for the quick reply. So you would make your choice with the select box and then proceed to the download button. Hi Josh, I would have suggested a form that contains the select-Element with all the corresponding files as options and a PHP script responsible for the download.

This way you would submit the form using the single button and the PHP script would send the selected file to the client. After a quick search at SO I found a solution that uses jQuery and looks nice as well — you might want to check this out too.

Hi Christian Thanks for the info, I ended up using a little jquery and got everything working properly. This is great!



0コメント

  • 1000 / 1000