Welcome to Dream.In.Code
Become an Expert!

Join 149,745 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,392 people online right now. Registration is fast and FREE... Join Now!




Download pop-up

 
Reply to this topicStart new topic

Download pop-up, Is this possible with php?

Boris_zZz
12 Feb, 2007 - 03:19 PM
Post #1

New D.I.C Head
*

Joined: 20 May, 2005
Posts: 18


My Contributions
hey guys, just wondering if this is possible with php:

say a user clicks a link to download a file - the user will then be taken to a new page where their download will pop-up (a save-file window)...
the new page will display some a form of some kind that the user can voluntarily fill in following the commencement of the download...

any suggestions will be helpful !

-boris
User is offlineProfile CardPM
+Quote Post

snoj
RE: Download Pop-up
12 Feb, 2007 - 06:42 PM
Post #2

Fell off the face of the earth
Group Icon

Joined: 31 Mar, 2003
Posts: 3,325



Thanked: 9 times
Dream Kudos: 750
My Contributions
This is html/javascript.

Moved.
User is offlineProfile CardPM
+Quote Post

Boris_zZz
RE: Download Pop-up
12 Feb, 2007 - 07:04 PM
Post #3

New D.I.C Head
*

Joined: 20 May, 2005
Posts: 18


My Contributions
QUOTE(hotsnoj @ 12 Feb, 2007 - 07:42 PM) *

This is html/javascript.

Moved.


ah yes, thanx smile.gif
User is offlineProfile CardPM
+Quote Post

haveacigar
RE: Download Pop-up
12 Feb, 2007 - 07:07 PM
Post #4

New D.I.C Head
*

Joined: 3 Feb, 2007
Posts: 15


My Contributions
QUOTE(Boris_zZz @ 12 Feb, 2007 - 08:04 PM) *

QUOTE(hotsnoj @ 12 Feb, 2007 - 07:42 PM) *

This is html/javascript.

Moved.


ah yes, thanx smile.gif


I would imagine it would involve meta refresh after you click the save file link... just to point you in the right direction..
User is offlineProfile CardPM
+Quote Post

Boris_zZz
RE: Download Pop-up
12 Feb, 2007 - 07:29 PM
Post #5

New D.I.C Head
*

Joined: 20 May, 2005
Posts: 18


My Contributions
QUOTE(haveacigar @ 12 Feb, 2007 - 08:07 PM) *

QUOTE(Boris_zZz @ 12 Feb, 2007 - 08:04 PM) *

QUOTE(hotsnoj @ 12 Feb, 2007 - 07:42 PM) *

This is html/javascript.

Moved.


ah yes, thanx smile.gif


I would imagine it would involve meta refresh after you click the save file link... just to point you in the right direction..


ah ok, but i thought clicking the save-file button is a browser function - how would i implement code in my webpage that is able to listen to when a user has clicked the save file button...

so far: i have used this

CODE
<body onload="java script:window.open('file.html');">


that opens a new window which directs the user to the file ....

CODE

<head>
<script type="text/javascript">
      <!-- hide
         window.location = "test.zip"
      // done hiding -->
    </script>
</head>


unfortunately the pop-up window is blocked in FF...
is there a way around this?
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Download Pop-up
12 Feb, 2007 - 08:19 PM
Post #6

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
it should only be blocked if scripts are disabled. You will have to post a warning to enable scripts.
User is offlineProfile CardPM
+Quote Post

snoj
RE: Download Pop-up
12 Feb, 2007 - 08:19 PM
Post #7

Fell off the face of the earth
Group Icon

Joined: 31 Mar, 2003
Posts: 3,325



Thanked: 9 times
Dream Kudos: 750
My Contributions
QUOTE

unfortunately the pop-up window is blocked in FF...
is there a way around this?

If there was, then there wouldn't be much use for a popup blocker.

Methinks that it mainly has to do if the user invokes the popup or not. That is I click something, so a window opens. I think.
User is offlineProfile CardPM
+Quote Post

Boris_zZz
RE: Download Pop-up
12 Feb, 2007 - 08:36 PM
Post #8

New D.I.C Head
*

Joined: 20 May, 2005
Posts: 18


My Contributions
QUOTE(hotsnoj @ 12 Feb, 2007 - 09:19 PM) *

If there was, then there wouldn't be much use for a popup blocker.

Methinks that it mainly has to do if the user invokes the popup or not. That is I click something, so a window opens. I think.


yeh i think ur right - the only reason the pop-up is being disallowed is because the user did not click anything,

ok so im thinking - is it possible to invoke two actions from one user event - eg a user clicks a link to dload a file (the save-file window will then invoke), and at the same time a new window with a new webpage is loaded?
User is offlineProfile CardPM
+Quote Post

Boris_zZz
RE: Download Pop-up
12 Feb, 2007 - 08:55 PM
Post #9

New D.I.C Head
*

Joined: 20 May, 2005
Posts: 18


My Contributions
QUOTE(Boris_zZz @ 12 Feb, 2007 - 09:36 PM) *


yeh i think ur right - the only reason the pop-up is being disallowed is because the user did not click anything,

ok so im thinking - is it possible to invoke two actions from one user event - eg a user clicks a link to dload a file (the save-file window will then invoke), and at the same time a new window with a new webpage is loaded?


ok so heres a quick fix (works fine in FF - i still get a prompt in IE - even though active scripting is set to 'enabled' and
not prompt)

CODE

Click<a href="test.zip" onclick="java script:window.open('test.html');">here</a>


Clicking the above link will open a save-file prompt for the test.zip file and open direct the user to test.html, simple and quick smile.gif

-boris

This post has been edited by Boris_zZz: 12 Feb, 2007 - 08:57 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 05:34AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month