SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist -T-'s Avatar
    Join Date
    Jun 2002
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript or iframe to iniate a download?

    I'm a bit unsure about which one to chose, as each one has it's disadvantages. IE has some security issues with downloading files that are loaded in an iframe. While some browsers don't like javascript (I know that is a small amount, but still a problem). I need some help on this, if someone could help me out. The two pieces of code are listed bellow. I'm not sure if the javascript on is correctly coded either to be honest. I appreciate the help

    Thomas

    Code:
    <iframe src="<? echo $serverurl.'/'.$seriesurl['seriesurl'].'/'.$file['fileurl']; ?>" name="lol" width="0" height="0" frameborder="0" scrolling="no"></iframe>
    Code:
    <script language=JavaScript>
     		    	setTimeout("location.href=<? echo $serverurl.'/'.$seriesurl['seriesurl'].'/'.$file['fileurl']; ?>" , 0)
      			</script>
    chrome is a wrapper that combines a browser with spyware

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Why not: <a href="file.ext">download file.ext</a>?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Evangelist -T-'s Avatar
    Join Date
    Jun 2002
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm trying to make it a little harder for people to find the link for direct linking
    chrome is a wrapper that combines a browser with spyware

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not set up a php page that serves the file, and checks the link referrer to make sure they clicked on a link from your own site.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •