Automatic Download
2014-02-02, 06:17 PM,
#1
Hello guys, here is my code
Quote:var expiration = 1, // minutes defined
timeout = expiration * 60 * 1000;

setTimeout(function () {
window.location.href = 'http://site.com/picture.jpg';
}, timeout);
It should work like that when someone visit site he get file downloaded automaticly to his computer after 1 minute. I puted it inside head part on page where they go. They first go to home of course and then to that page. What is problem? Why it doesn't work?
Latest Thanks - View all

kingstha(2014-02-05 03:55 PM) 
Reply
2014-02-02, 06:24 PM,
#2
Hi vikas, so let me get this right, someone visit your website, after 1 minute it will automatically download a .jpg (image) ?

Anyway you code looks clean, I made a jsfiddle: http(semicolon)//jsfiddle.net/r7Jb6/

Note that I edited the timer to 5 sec.. instead of 60.
Reply
2014-02-02, 06:36 PM,
#3
check it out
httpwww.dodaj.rs/f/3v/8k/2sW0q1kt/prb.png
still nothing :(
Reply
2014-02-02, 06:37 PM,
#4
Do you want your visitors to download the image instead of displaying it in the browser?

If so use this,

http(:)//jsfiddle.net/r7Jb6/2/

(remember to edit the time from 5, to 60.
Reply
2014-02-02, 06:41 PM,
#5
(2014-02-02, 06:37 PM)steffen25 Wrote: Do you want your visitors to download the image instead of displaying it in the browser?

If so use this,

http(:)//jsfiddle.net/r7Jb6/2/

(remember to edit the time from 5, to 60.

Yes, actually it will be .txt file, I just used image for example. Still nothing happens :/
Reply
2014-02-02, 06:42 PM,
#6
(2014-02-02, 06:41 PM)vikas Wrote:
(2014-02-02, 06:37 PM)steffen25 Wrote: Do you want your visitors to download the image instead of displaying it in the browser?

If so use this,

http(:)//jsfiddle.net/r7Jb6/2/

(remember to edit the time from 5, to 60.

Yes, actually it will be .txt file, I just used image for example. Still nothing happens :/

Show me that website you are trying to integrate this script. This script works as you see on jsfiddle :)
Reply
2014-02-02, 06:46 PM,
#7
(2014-02-02, 06:42 PM)steffen25 Wrote:
(2014-02-02, 06:41 PM)vikas Wrote:
(2014-02-02, 06:37 PM)steffen25 Wrote: Do you want your visitors to download the image instead of displaying it in the browser?

If so use this,

http(:)//jsfiddle.net/r7Jb6/2/

(remember to edit the time from 5, to 60.

Yes, actually it will be .txt file, I just used image for example. Still nothing happens :/

Show me that website you are trying to integrate this script. This script works as you see on jsfiddle :)
Can you please leave me your skype or something like that?
Reply
2014-02-02, 06:49 PM,
#8
(2014-02-02, 06:46 PM)vikas Wrote:
(2014-02-02, 06:42 PM)steffen25 Wrote:
(2014-02-02, 06:41 PM)vikas Wrote:
(2014-02-02, 06:37 PM)steffen25 Wrote: Do you want your visitors to download the image instead of displaying it in the browser?

If so use this,

http(:)//jsfiddle.net/r7Jb6/2/

(remember to edit the time from 5, to 60.

Yes, actually it will be .txt file, I just used image for example. Still nothing happens :/

Show me that website you are trying to integrate this script. This script works as you see on jsfiddle :)
Can you please leave me your skype or something like that?
PM me your skype, or leave it in the thread.
Reply
2014-02-02, 06:51 PM,
#9
(2014-02-02, 06:49 PM)steffen25 Wrote:
(2014-02-02, 06:46 PM)vikas Wrote:
(2014-02-02, 06:42 PM)steffen25 Wrote:
(2014-02-02, 06:41 PM)vikas Wrote:
(2014-02-02, 06:37 PM)steffen25 Wrote: Do you want your visitors to download the image instead of displaying it in the browser?

If so use this,

http(:)//jsfiddle.net/r7Jb6/2/

(remember to edit the time from 5, to 60.

Yes, actually it will be .txt file, I just used image for example. Still nothing happens :/

Show me that website you are trying to integrate this script. This script works as you see on jsfiddle :)
Can you please leave me your skype or something like that?
PM me your skype, or leave it in the thread.

here it is pastebin.com/Uj4afUPy
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help needed - Download link freakkz 3 556 2017-01-29, 10:23 PM
Last Post: CharlieHarper
  Download KING POWER V1.0.5 – THEMEFOREST RETINA READY MULTI-PURPOSE THEME Tiffani 7 1,295 2015-03-28, 02:19 PM
Last Post: L0gic
  Download PUZZLES – THEMEFOREST WORDPRESS MAGAZINE/REVIEW THEME Tiffani 1 456 2015-03-02, 12:08 PM
Last Post: Grapes
  Download IMPRESSION V1.19 – THEMEFOREST PREMIUM CORPORATE PRESENTATION WP THEME Tiffani 8 851 2015-02-25, 12:52 PM
Last Post: Tiffani
  Download MOJOTHEMES – E-STYLE V1.8 – A FASHION WORDPRESS THEME Tiffani 0 542 2015-01-19, 12:37 PM
Last Post: Tiffani





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top