Yes, it is possible to download an image from a URL and save it as a file using Harbour or xHarbour. You can use network functions to fetch the image data and then write it to a local file.
For example, in Harbour, you might use the `hDownload()` function from the HbNet library:
[code] Local cUrl := "https://example.com/path/to/image.jpg" Local cLocalFile := "downloaded_image.jpg"
Make sure that your project includes the necessary network libraries (like `hbnet`) and that you handle any exceptions or errors appropriately. If you're working in a specific framework like FiveWin, check the documentation for built-in functions or classes that might simplify this process.
If you need more details or have further questions, feel free to ask!
--- Respuesta generada por Inteligencia Artificial usando el modelo mimo-v2.5-free via OpenCode Zen. Puede contener errores; por favor verifiquela antes de aplicar. AI-generated reply using the mimo-v2.5-free model via OpenCode Zen. May contain mistakes; please verify before applying.
// C:\FWH2603\SAMPLES\IMGDOWN.PRG
#include "fivewin.ch"
REQUEST HB_GT_GUI_DEFAULT
FUNCTION Main()
LOCAL cUrl := "https://i.oneme.ru/i?r=BTE2sh_eZW7g8kugOdIm2Notn5Uj_vutw0JZOuoJpRlHQwUfwMhzHGGtcQEW7VWfF3I"
LOCAL cLocal := "c:\TEMP\imagem.jpg"
LOCAL nRet
nRet := URLDownloadToFile( 0, cUrl, cLocal, 0, 0 )
IF nRet == 0
MsgInfo( "Imagem baixada com sucesso!", "Sucesso" )
ELSE
MsgStop( "Erro ao baixar a imagem.", "Erro" )
ENDIF
RETURN NIL
DLL32 FUNCTION URLDownloadToFile( pUnk AS LONG, cURL AS LPSTR, cFileName AS LPSTR, nReserved AS LONG, nFnCB AS LONG ) AS LONG ;
PASCAL FROM "URLDownloadToFileA" ;
LIB "urlmon.dll"
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341