>Hi friends
>
>This is the point: The instructions below download a PDF file with information about a fiscal key (cCuit)
>
>oconstancia = Createobject("Shell.Application")
>oconstancia.Open("
https://soa.afip.gob.ar/sr-padron/v1/constancia/"+STRTRAN(cCUIT,'-',''))
>
>Since the file is downloaded (and opened) in the default download fold I could research using environment variables and somehow I could get the data I desire: THE NAME OF THE FILE
>
>But there should be a better method I don't know without opening the file and that's why I'm here right now...
>
>The instruction below puts MY specified name, and that's not what I want.
>
>lnGetResults = URLDownloadToFile(0, lcGetURL, lcTempTxtFile, 0, 0)
>
>Does anyone know how I cant obtain the name of the file downloaded?
>
>Thank you.
>
> Héctor
If the name of the file is passed by the web service, then most probably it is coming downstream in the response header.
CLEAR
LOCAL SXMLHTTP AS MSXML2.ServerXMLHTTP60
m.SXMLHTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
m.SXMLHTTP.Open("GET", ""https://soa.afip.gob.ar/sr-padron/v1/constancia/" + STRTRAN(m.cCUIT, '-' ,''), .F.)
m.SXMLHTTP.Send()
? m.SXMLHTTP.Getresponseheader("Content-Disposition")
WAIT WINDOW "Press a key..."
?
? m.SXMLHTTP.Responsebody
----------------------------------
António Tavares Lopes