Hi,I’m looking for a way to pass an URL to a piece of LotusScript code running on a Domino server (agent or webservice). The code has to download a file targeted by this URL and store it at a given location either in the file system or probably in a Notes document.
Should it be of any relevance: the server in questions is V 7.0.2, running on a Win32 system.
I feel that Jave might the better choice, but due to customer specifications I’m bound to build this using LS.
Subject: How to download a file using LotusScript?
Hi,
There is a great example in Lotus Designer Help that provide the LotusScript for downloading a file from a URL. Search for the following classes and methods:
NotesEmbeddedObject
NotesRichTextItem
NotesDatabase.GetDocumentbyurl()
NotesDocument.GetAttachment()
NotesEmbeddedObject.ExtractFile()
NotesEmbeddedObject.EmbedObject()
To be able to download a file from a URL, the task “Web Retriever” should be active on the Domino server( load web )otherwse the Lotus Notes client will not be able to perform the download.
when I pressed the POST link on my main topic I already felt that my question might be mistaken. Thanks to the answers already given, but that’s not what I’m looking for.
So to clarify things a bit:
assume, there is some generic file somewhere on the web, e.g. some zip file. There’s an URL available pointing to that file, say
Using this URL in my browser usually would ask me for a location in my file system to store the zip to.
What I’m looking for now is a way to pass that URL to some server based LS code (agent or webservice). The URL will be different each time the code is called. The code then should go and fetch the file and store it at a given location in the file system.
Don’t worry about security or other obstacles here, let’s assume we know what we’re doing
Subject: How to download a file using LotusScript?
I have many agents that download files from ftp server, run basic ftp command from windows. If you want to download from web server, maybe you can use wget or something that can be run from command prompt.Sample Script:
Dim TaskID as Integer
TaskID = Shell (“c:\batch\todownload.bat”)
The script will wait for shell program to finish before continue running.
Subject: RE: How to download a file using LotusScript?
thanks a lot, wget hepled!
only thing that doesn’t yet work out for me (yet) is that the script in my case DOES NOT wait for the called prog to finish; i guess i’ll have to make sure that something is written somewhere through the shell prog, and have my script check for the existince of that entry. or do you have a smarter idea?