Author Topic: How to get List of all Files on a FTP Page  (Read 4787 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 494
How to get List of all Files on a FTP Page
« on: August 06, 2016, 08:23:41 AM »
How to get List of all Files on a FTP Page through autolisp ?

ChrisCarlson

  • Guest
Re: How to get List of all Files on a FTP Page
« Reply #1 on: August 08, 2016, 08:11:29 AM »
Didn't think it was possible to upload / download BUT

Code - Auto/Visual Lisp: [Select]
  1. ;;https://www.theswamp.org/index.php?topic=43337.msg485805#msg485805
  2.   "ftp://user:password@ftp.domain.com//public//sites//www.domain.com//files//"
  3.   "c:\\test.dwg"
  4. )

For a list of files, that would mainly be dependent on the FTP server if it allows say "site list"

mailmaverick

  • Bull Frog
  • Posts: 494
Re: How to get List of all Files on a FTP Page
« Reply #2 on: August 09, 2016, 11:09:25 AM »
Thanks for your reply but I need to get list of files, not put any file.

Also site list is allowed and there is no username and password.


dgorsman

  • Water Moccasin
  • Posts: 2437
Re: How to get List of all Files on a FTP Page
« Reply #3 on: August 09, 2016, 03:48:00 PM »
Is this some specific location, or just fishing on any random one?
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

mailmaverick

  • Bull Frog
  • Posts: 494
Re: How to get List of all Files on a FTP Page
« Reply #4 on: August 11, 2016, 03:32:36 PM »
There is my company's internal intranet which I want to explore through LISP.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: How to get List of all Files on a FTP Page
« Reply #5 on: August 11, 2016, 03:40:23 PM »
If it's internal, why do you need FTP?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: How to get List of all Files on a FTP Page
« Reply #6 on: August 11, 2016, 05:07:30 PM »
wget --no-remove-listing ftp://ftp.opera.com/pub/opera/win/1218/en/

wget will create file .listing in its folder
just read it and parse the contents

get it http://gnuwin32.sourceforge.net/packages/wget.htm

mailmaverick

  • Bull Frog
  • Posts: 494
Re: How to get List of all Files on a FTP Page
« Reply #7 on: August 11, 2016, 06:29:45 PM »
If it's internal, why do you need FTP?

Internal means company's files are stored on  a FTP server for use by various people.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: How to get List of all Files on a FTP Page
« Reply #8 on: August 12, 2016, 09:52:28 AM »
Gotcha .. so hosted storage.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mailmaverick

  • Bull Frog
  • Posts: 494
Re: How to get List of all Files on a FTP Page
« Reply #9 on: August 14, 2016, 12:35:41 PM »
Thanks Vovka for wget but is it possible in LISP ?

I dont want to modify or put any file but just want list (directory listing) of files.

Please help.

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: How to get List of all Files on a FTP Page
« Reply #10 on: August 14, 2016, 01:51:11 PM »
Thanks Vovka for wget but is it possible in LISP ?
i don't know any means to do this without extra components

PKENEWELL

  • Bull Frog
  • Posts: 309
Re: How to get List of all Files on a FTP Page
« Reply #11 on: August 15, 2016, 03:10:41 PM »
Why not use a Shell interface with the command-line FTP command with DIR and -s:filename? I do not have an FTP to test, but if you could send me an example that I could access, I could give it a try and see if it works.

http://www.nsftools.com/tips/MSFTP.htm
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt

mailmaverick

  • Bull Frog
  • Posts: 494
Re: How to get List of all Files on a FTP Page
« Reply #12 on: August 15, 2016, 10:56:42 PM »
Following example can be used :

ftp://ftp.opera.com/pub/opera/win/1218/en/


ChrisCarlson

  • Guest
Re: How to get List of all Files on a FTP Page
« Reply #13 on: August 16, 2016, 08:04:43 AM »
wget --no-remove-listing ftp://ftp.opera.com/pub/opera/win/1218/en/

wget will create file .listing in its folder
just read it and parse the contents

get it http://gnuwin32.sourceforge.net/packages/wget.htm

This is probably your best bet.

PKENEWELL

  • Bull Frog
  • Posts: 309
Re: How to get List of all Files on a FTP Page
« Reply #14 on: August 16, 2016, 09:58:12 AM »
Following example can be used :

ftp://ftp.opera.com/pub/opera/win/1218/en/

Hmmm. I used NSLOOKUP to get the IP address as required (correction - you can also use a domain) by the FTP program "open" command. I am able to connect to the server you gave, but it will not allow the DIR command unless I "login with USER and PASS". I did not think there was any login requirement. Well - In theory, you should be able to use a Batch file, and direct the output to a text file then read the file back in to a variable in AutoLISP. If you can figure out the proper way to get the info using the FTP command and give me the sequence in a batch file, I will try writing you a routine to run it and retrieve the output.
« Last Edit: August 16, 2016, 10:09:06 AM by PKENEWELL »
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt