0

So I am thinking maybe through a form, similar to how you would do image upload, but instead of freely choosing a file from your computer to a chosen folder on the server, then saving a specific file from server to a freely chosen folder on the computer.

<form action="save.php" method="post" enctype="multipart/form-data">
    <input type="file" name="fileToUpload" id="fileToUpload">
    <input type="submit" value="Save File" name="submit">
</form>

<?php
    if(isset($_POST["submit"])) {
        //save file to chosen folder on computer.
    }
?>

Kinda just like when you save a document on your computer and get to save it in any folder you choose.

Daniel Alsaker
  • 193
  • 3
  • 15
  • 2
    That's called "download" and is supported by Apache by default. – laurent Dec 01 '16 at 13:56
  • @RiggsFolly haha yes indeed. I believe you have misunderstood my question. I don't want the user to save the file to the server, I want them to save a file from the server to a folder of their choice on their own computer. – Daniel Alsaker Dec 01 '16 at 14:01
  • Browser handles that, when ever a user download, the browser will let them choose where thy wanna save, if its not specified by default @DanielAlsaker – Masivuye Cokile Dec 01 '16 at 14:02
  • See the Dup Question and answer for how thats done – RiggsFolly Dec 01 '16 at 14:03
  • @RiggsFolly This does not solve my problem, as it just directly downloads it to the downloads folder on the users computer. I want the user to be able to choose, from the website, which folder the file should be saved to. – Daniel Alsaker Dec 01 '16 at 14:16
  • @MasivuyeCokile Is there no way to make the browser do this? Like if you make a "save as" button. I know the user could just right click and choose the save as option, but just for an example, are there no ways of making that kinda function? – Daniel Alsaker Dec 01 '16 at 14:21
  • 1
    @DanielAlsaker Read here : http://stackoverflow.com/questions/34870711/download-a-file-at-different-location-using-html5 – Masivuye Cokile Dec 01 '16 at 14:24
  • 1
    It only directly downloads it to the `downloads` folder if the user has set their browser to automatically put all downloads into that folder. You cannot control what the user of your system does with those settings. – RiggsFolly Dec 01 '16 at 14:30
  • @MasivuyeCokile ah, I see. Too bad... Thank you for providing an answer! – Daniel Alsaker Dec 01 '16 at 14:33

0 Answers0