Find

Article
· Jun 20, 2024 2m read

How to upload/download image files from an FTP server

InterSystems FAQ rubric

The procedure for uploading/downloading from an FTP server is as follows.

1. Upload the image file to the FTP server

 set tmpfile="c:\temp\test.jpg"
 set ftp=##class(%Net.FtpSession).%New() 
 // connect to FTP server
 do ftp.Connect("","<username>","<password>")
 // set transfer mode to BINARY
 do ftp.Binary()
 // Move to the directory to upload
 do ftp.SetDirectory("/temp/upload")
 // Prepare a stream of files to upload  
 set file=##class(%File).%New(tmpfile)
 do file.Open("UK\BIN\")
 // upload file
 // 1st argument: File name to create at upload destination
 // 2nd argument: File stream to upload
 do ftp.Store("test.jpg",file)
 // Logout from ftp server
 do ftp.Logout()
 // close the file
 do file.Close()
 // (Optional) Delete the uploaded file
 //do ##class(%File).Delete(tmpfile)

2. Download the image file from the FTP server

   set ftp=##class(%Net.FtpSession).%New()     // Connect to ftp server
    do ftp.Connect("","<username>","<password>")     // Set the transfer mode to BINARY
    do ftp.Binary()     // Prepare a file stream to download and store
    set stream=##class(%FileBinaryStream).%New()
    do stream.LinkToFile("c:\temp\testdownload.jpg")
   // Go to the download directory
    do ftp.SetDirectory("/temp/download")     // Download the file and close the stream
    do ftp.Retrieve("test.jpg",stream)
    do stream.SaveStream()
    Set stream=""     // Logout from the ftp server
    do ftp.Logout()

Discussion (0)1
Log in or sign up to continue
Announcement
· Jun 20, 2024

[Video] Ingestão de alta velocidade usando InterSystems IRIS Persister com Java

Olá Comunidade,

Reproduza o novo vídeo em InterSystems Developers YouTube:

⏯ High-Speed Ingestion Using InterSystems IRIS Persister with Java @ Global Summit 2023

Descubra os novos recursos do InterSystems IRIS para ingestão em alta velocidade usando Java. Você irá aprender como este recurso é aplicado em dois de seus muitos casos de uso: 

  • Executar cargas de trabalho simultâneas de ingestão e análise de alta velocidade usando SQL;
  • Message Broker de alta velocidade para enriquecimento de mensagens.

Apresentadores:
🗣 @Saurav Gupta, Sales Engineer, InterSystems
🗣 @Elijah Cotterrell, Sales Engineer, InterSystems

Divirta-se assistindo e fique ligado para mais vídeos! 👍

Discussion (0)1
Log in or sign up to continue
Question
· Jun 20, 2024

Prevent auto formatting after compilation in Studio.

Hi,

I would like to ask whether there is some option to stop auto-formatting when I compile.  The code is sometimes well formatted but the auto-formatter does not work correctly in some situations. I am talking about the compilation in the Studio editor in this image, not about Visual Studio Code.

Thank you in advance,

 

Alin C Soare.

6 Comments
Discussion (6)4
Log in or sign up to continue
Question
· Jun 20, 2024

Replacement for deprecated %ZEN class

My team and I noticed that the %ZEN class documentation labeled all properties and methods as deprecated.

Example: %ZEN.Auxiliary.altJSONProvider - InterSystems IRIS Data Platform 2024.1 - including private class members

 

In this regard, the big question is: what will be used to replace these methods, in particular %ZEN.Auxiliary.altJSONProvider?

It is used as the basis for the MDX2JSON package, from which DeepSeeWeb gets data to build Analytical Dashboards.

 

Is a replacement proposed for deprecated methods of %ZEN class?

And when is this functionality scheduled to be permanently disabled?

20 Comments
Discussion (20)8
Log in or sign up to continue
Question
· Jun 20, 2024

Monitoring de la file d'attente Intersystems

Bonjour,

Je cherche à monitorer la file d'attente intersystems. Prometheus est activé mais j'ai la métrique iris_interop_queued qui ne renvoie rien (je pense que l'on ne parle pas de la même chose).

Y'a t il moyen de requêter une table, une classe, de remonter ça dans prometheus ? 

Merci d'avance

Claude

2 Comments
Discussion (2)1
Log in or sign up to continue