Jump to content

Auto Download


SJames

Recommended Posts

I'm not sure whether I would use PHP for this or not, but what I am trying to do is automatically download a file when a window opens.

 

I have a page with a link on it. When the link is clicked, a window pops up with a link to a file in it. I would like to be able to have that file start downloading as soon as the window opens. I'm not sure if this would be PHP or Javascript- any help would be nice, I can't seem to find this anywhere.

Link to comment
https://forums.phpfreaks.com/topic/68061-auto-download/
Share on other sites

I don't think that's what I'm looking for- I looked that up and tried it and it's more of a redirect. I'm talking about something more like the download sites where they bring you to a page and then you get the little "Website is trying to download file to your computer" thing. How to to try to download that file to your computer?

Link to comment
https://forums.phpfreaks.com/topic/68061-auto-download/#findComment-342113
Share on other sites

I think you can us this code

 

header("location:download.zip");

 

make sure this code should be at the top of page and no echo or print before this

 

sorry you replied while i was typing.

 

I think you can do it by making a download page that print the downloading message and open the download fie in new window.

Link to comment
https://forums.phpfreaks.com/topic/68061-auto-download/#findComment-342115
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.