0

If i have a path like below:

"/sites/main/files/myfile.zip"

How can I download the file using PHP?

I tried something like below but nothing happens. Anyone has any ideas?

$myzipfile =  "/sites/main/files/myfile.zip";
file_put_contents("myfile.zip", file_get_contents( $myzipfile ));
CloudSeph
  • 863
  • 4
  • 15
  • 36
  • Sorry your question is not clear. I dont see anywhere where you are DOWNLOADING anything. Can you add some clearer explanation of your problem please – RiggsFolly Oct 15 '18 at 15:30
  • @RiggsFolly i just see online and follow the code as above. is that code not to download? if not then can you suggest a way to download via php? – CloudSeph Oct 16 '18 at 02:43
  • Are you trying to send a file to the client PC or get a file from the client PC to the server – RiggsFolly Oct 16 '18 at 07:57
  • @RiggsFolly I want to get a file from the server to the client pc – CloudSeph Oct 16 '18 at 07:59

0 Answers0