Results 1 to 14 of 14
  1. #1
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post

    download text file from HTTPS or FTP

    Trying to automate a process for a client, where we have a known location for a text file - one is HTTPS, the other FTP - doing it manually, I can enter
    ftp://UserName:Password@url/file (or similar) into the browser, then save the result. However, try as I might, I have failed to find a method of automating this - IDEALLY this is done without installing extra software (as I cannot guarantee what the client will have, nor how techy his employees are) but IE or Chrome will be ok, as will any references to XML etc are fine. I'm also fine with going to the site and THEN putting the user name and password if that would be more productive - any help VERY gratefully received.

  2. #2
    Silver Lounger
    Join Date
    Mar 2014
    Location
    Forever West
    Posts
    2,078
    Thanks
    0
    Thanked 259 Times in 248 Posts
    Quote Originally Posted by aidan100 View Post
    Trying to automate a process for a client, where we have a known location for a text file - one is HTTPS, the other FTP - doing it manually, I can enter
    ftp://UserName:Password@url/file (or similar) into the browser, then save the result. However, try as I might, I have failed to find a method of automating this - IDEALLY this is done without installing extra software (as I cannot guarantee what the client will have, nor how techy his employees are) but IE or Chrome will be ok, as will any references to XML etc are fine. I'm also fine with going to the site and THEN putting the user name and password if that would be more productive - any help VERY gratefully received.
    My way is simple, I Upload .txt, .pdf and other files to my Domain using CuteFTP then when I want to Download I go to my main page and add the file name at the end of the URL as in www.mydomain.com/fisherman.txt or churchdirectory.pdf [for example] then the file opens as a page in the browser. If it's an .exe/Executable file I get a choice of Save or Cancel. If it's a .zip file I get a choice of Open with Winzip or Save or cancel. If desired I can share the URL with the file name with someone else.

    If I want a lot of traffic I could put the URL as a link on one of my pages.

  3. #3
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Berton View Post
    My way is simple, I Upload .txt, .pdf and other files to my Domain using CuteFTP then when I want to Download I go to my main page and add the file name at the end of the URL as in www.mydomain.com/fisherman.txt or churchdirectory.pdf [for example] then the file opens as a page in the browser. If it's an .exe/Executable file I get a choice of Save or Cancel. If it's a .zip file I get a choice of Open with Winzip or Save or cancel. If desired I can share the URL with the file name with someone else.

    If I want a lot of traffic I could put the URL as a link on one of my pages.
    Thanks for taking the time to reply - re-reading my question I see I wasn't clear enough - the process I'm trying to automate is to download a file regularly updated by my client's supplier - the name and location (and password details) are all standard, so the manual process is simple enough - but I want my Excel (or Access) VBA to be able to automatically grab that data and update the relevant records - and getting the data is proving to be a sticking point.

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 986 Times in 916 Posts
    VBA will allow you to download files.
    http://officetricks.com/download-fil...e-using-excel/

    cheers, Paul

  5. #5
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post
    sadly that method was one of the ones I'd found and discounted, as it won't work (for whatever reason) with the password and username included in the URL - and obviously trying it without means I cannot automate the process. I'm happy to PM the full URL details to anyone who thinks they can get it to work - it's not especially secret as it is the same for all registered users, but I don't want to post it publicly!!

  6. #6
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,733
    Thanks
    95
    Thanked 128 Times in 125 Posts
    Can you post a pretend, complete, URL? As you get ideas from others here, you simply change the pretend names used in here to the real names in your office.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

  7. #7
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post
    well, I can, but it will look a lot like the example in the OP -
    https://www.aidanheritage.co.uk/wsdata/datafeed2.txt would be an example without the username and password and
    https://username:password@www.aidanh.../datafeed2.txt
    would be the password version - both URL's are invalid - if you want to test with REAL URLs I can private message you.

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    When downloading the file manually, are you challenged for the username and password before you navigate to the file and download it? Or is it a single step process.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  9. #9
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post
    if you go to the URL itself, a pop up will appear asking for the user name and password (a normal password protected site in other words). If you use the "trick" of putting in the user name and password in the URL (eg https://username:password@www.aidanh.../datafeed2.txt) then you can download without a further step. Obviously from an automation point of view, the method doesn't matter as it's automatic.

  10. #10
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    If you haven't sorted it out yet, PM the actual info to me and I'll have a look to see if I can help.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  11. #11
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I found a post on another forum that works when adapted to the information you posted by PM

    http://stackoverflow.com/questions/1...ernet-explorer

    Apparently, that code was adapted from http://social.msdn.microsoft.com/For...e-csv-from-url
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  12. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    aidan100 (2016-07-26)

  13. #12
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post
    many thanks to those who came up with suggestions, especially Andrew Lockton who got it working - I've NOW discovered that it is machine dependant (which is why my tests didn't work) so it will be interesting to see if the clients machine works or not - no wonder my attempts failed badly though!

  14. #13
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Perhaps your firewall is causing it to not work.

    I could only get the https link to work on my machine. I didn't have any luck with the ftp site.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  15. #14
    Lounger
    Join Date
    May 2003
    Posts
    29
    Thanks
    3
    Thanked 1 Time in 1 Post
    the HTTPS version is working really well now - thanks Andrew for that - the FTP is going to need an alternative approach I think - still working on that - the good news is that the site with the bigger issue from a manual point of view is the HTTPS one, so we have already saved time, but it would be good to get a working solution for the other site - I'll keep at it and when the answer is found I bet it will be stupidly obvious!

Posting Permissions

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