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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.