nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Download with timer?

This is a discussion on Download with timer? within the Shell scripting forums, part of the Development/Scripting category; First of all Happy New Year to everyone! I'm not sure this is the right place to ask but..I hope ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 01-02-2006, 08:47 PM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default Download with timer?

First of all Happy New Year to everyone!

I'm not sure this is the right place to ask but..I hope someone will point me to the right directions.

I need some sort of a script that will redirect a user to a .html page when he goes to a file. When the user is redirected to this html page there's a countdown timer - counting from 10, 9, 8....etc. When the timer reaches 0, the user is redirected to the file he requested. Makes sense?

Every link will be on a html page (i.e. www.domain.com/files/file1.zip). I don't want the user to be able to directly download this file.

Let me show you something like what I want in action.

http://rapidshare.de/files/10258061/Rose.jpg.html

As you see the file got renamed (somehow) to Rose.jpg.html - this is what I want (if possible).

When you go to http://rapidshare.de/files/10258061/Rose.jpg.html there's a lot of stuff there but if you scroll down, there's the "Free" button which will display the image.

My english is not that great but I hope you got the point. If someone can help me with this or point me to some directions....I'd really appreciate it.

Thanks for reading

Marin Micoriciu
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-03-2006, 02:17 AM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 4
tom is on a distinguished road
Default

I think you should able to do that with javascript or even php. Why you need shell scripts? any specific reason?

I think they are using something like Apahce Mod ReWrite support to redirect user.
Reply With Quote
  #3 (permalink)  
Old 01-03-2006, 07:47 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default

I think it can be done with javascript and/or php but not sure how. I don't really want a shell script. I didn't know where to post so I posted here. Admins or mods, move this thread to another forum if necessary... I was just asking if someone knows how to do it

Reply With Quote
  #4 (permalink)  
Old 01-05-2006, 07:40 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Note sure what you want. I really don't know php or javascript. All I can say it is some sort of server programming along with apache. I saw the source code of both pages. When you uploaded Rose.jpg it was NOT stored on normal location it was somewhere in protected area so that you can not directly access or download it using wget. When you click on Free button it copies back file to random location or may be soft link and you can get it. Everytime download url changes and if u try to use wget it will not work
http://dl6.rapidshare.de/files/10258...08852/Rose.jpg
http://dl6.rapidshare.de/files/10258...12407/Rose.jpg

It is all hard core php programming I think along with MySQL to keep track of all uploaded and download files plus it use session along with Apache rewrite i guess.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #5 (permalink)  
Old 01-19-2006, 10:38 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default

Thanks for replying. Anyone know how to do this? I'm willing to pay. My budget is $50 for this script.
Reply With Quote
  #6 (permalink)  
Old 01-19-2006, 03:58 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default

Let us say your download filename is
first.bmp

Then your main page name is index.php. index.php redirects using rd.php

index.php
Code:
<?php
function redir_link( $url, $text )
{
?>
<?php echo( $text ); ?>
<?php
}
?>
<html>
<body>
<h1>Main menu:</h1>
<?php redir_link( 'first.jpg', 'Download first.jpg' ); ?>

</body>
</html>
rd.php
Code:
<html>
<head>
<script language="Javascript">
function rdPage()
{
  window.location='<?php echo( $_GET['url'] ); ?>';
}
function pageRdTimer()
{
  window.setTimeout( "rdPage();", 5*1000 );
  // 5*1000 == 5 second
}
</script>
</head>

<body onload="pageRdTimer()">
Please support us:
<h1>Here is my ad</h1>


Redirecting to download section please wait...

</body>
</html>
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
  #7 (permalink)  
Old 01-23-2006, 12:53 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

I think you can try out some ad managemet software just search it using google
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Inactivity timer for lighttpd petu Web servers 0 03-11-2008 01:49 PM
gcc 3.4.6 rpm download chiku Linux software 2 05-18-2007 05:21 PM
If error repeat the download? karabaja Shell scripting 3 10-10-2006 03:32 AM
Linux desktop download rogy Linux software 2 01-05-2006 08:06 PM


All times are GMT +5.5. The time now is 07:12 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36