SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to download and save a website static file

    I have a requirement to download a website static file like the below examples and directly save in my local computer machine in some input path given (ex:c:\\My Documents)
    http://yahoo.com/myuri/mypath/myfile.img
    http://yahoo.com/myuri/mypath/myfile.xls
    http://yahoo.com/myuri/mypath/myfile.pdf
    http://yahoo.com/myuri/mypath/myfile.txt

    this whole operation should not open any dialog box, any prompt to save. The whole operation of opening the given online file path and saving them should happen through code. Can i achieve this in javascript or Jquery ? If so please give me the direct sample code with code library inclusions.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Sorry, but that is not possible to achieve due to it being such an extreme security risk.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,168
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    May not be what you want, but if the file is zipped and you link to it, it will just download—at least on my system.

  4. #4
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Sorry, but that is not possible to achieve due to it being such an extreme security risk.
    Yes but the files i am giving as example are assumed to be unprotected. i gave yahoo.com as an example only. Its like my own web application has some static files which i want to download inside a separate html/javacscript.


Tags for this Thread

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
  •