Downloading a file from a server in php




















And as i am not using ssh i cannot use wget. I was thinking of php or per or cgi may be. Executing a basic curl request will simply return the data to the output stream.

But we don't want that. Instead, we must assign it to a php variable, which we can write it to the disk. Improve this question. Cyclonecode Roshan Shaw Roshan Shaw 35 1 1 gold badge 2 2 silver badges 7 7 bronze badges. What do you need to do that can't be done by just letting the server manage it?

Why do you need to involve Ajax? Add a comment. Active Oldest Votes. Improve this answer. Waldz Waldz 6 6 bronze badges. Just dont use it when.

It helps browser to determine program for file opening movie, image, MS word etc. HTML Code:. Are you want to get implementation help, or modify or enhance the functionality of this script? Submit Paid Service Request. If you have any questions about this script, submit it to our QA community - Ask Question. Thank you dear, its really helped me alot.

Your Website. Using the normal anchor link with file path is publicly open and the file path can be found easily. But if we force download a file using PHP, then the file path will be hidden. So, for security reason sometimes PHP for download is necessary. But in those cases where there is no problem to let users know the file path, then it is okay to use the simple anchor link to let people download the file with that link.



0コメント

  • 1000 / 1000