Accéder à Internet via un proxyQuelqu'un a-t-il réussi à télécharger un fichier (sans l'ouvrir en tant que table de données) à l'aide d'un script provenant d'Internet via un proxy utilisant JMP? Si oui, comment avez-vous fait?
Par exemple, comment puis-je télécharger le Logo SAS un fichier sur mon ordinateur derrière un proxy?
Re: Accéder à Internet via un proxyGénial, j'accepterai même le téléchargement du logo JMP au lieu du logo SAS. Cela semble également fonctionner dans les scripts appelés à partir du planificateur de tâches. Pour ma simple exigence, voici ce que j'ai atterri:
FileDownload = Function( { sourceurl, destpath },
{ download, temppath, result},
result = 0; //Set to 1 if successfull
Try(
// Download file as a zip (saves the file to a temporary
// location and waits for commands)
download = Open( sourceurl , zip );
// grab the temporary filename
temppath = Parse( Regex( Char( download ), "\!"[^\!"]+\!"" ) );
// Move the file to its new location
If( Move File( temppath, destpath ) == 1, result = 1 );
);
return(result);
);
FileDownload( "https://www.sas.com/profile/ui/images/logos/jmp.png", "$temp/jmplogo.png" );
Open( "$temp" );Merci @Craige_Hales et @Justin_Chilton
Re: Accéder à Internet via un proxyEssaye ça; cela ne fonctionnera pas avant JMP 12, mais semble fonctionner à la fois en 12 et en 13. Il utilise un effet secondaire @Justin_Chilton m'a fait remarquer récemment. Vous devriez en faire une fonction si vous devez l’appeler de plusieurs endroits.
// work-around. Load Text File("https:...", blob) should be able to
// do this, but currently the blob support only works for disk files.
//
// pretend the file is a zip file. it will be downloaded to await
// zip archive commands, but we won't actually use them.
download = Open( "https://www.sas.com/profile/ui/images/logos/jmp.png", zip );
// grab the temporary filename
file = Parse( Regex( Char( download ), "\!"[^\!"]+\!"" ) );
// *now* use Load Text File to access the binary data
binary = Load Text File( file, blob );
// the open function can use a binary blob if it is told the type
image = Open( binary, "png" );
// finally, show the image
New Window( "image", image );Re: Accéder à Internet via un proxyBonjour Peter,
J'aurais dû préciser que je cherchais une solution de script pour télécharger un fichier plutôt que de l'ouvrir. J'ai mis à jour la question pour refléter cela. Internet Open semble obtenir des informations de proxy d'Internet Explorer, mais dans ce cas, je dois manipuler le fichier avant de pouvoir l'ouvrir.
Re: Accéder à Internet via un proxyJe ne suis pas sûr que ce soit ce que vous cherchez, mais la documentation générale du système JMP permettant de télécharger un fichier à partir d'Internet ou d'un ordinateur distant se trouve ici, dans la documentation du système en ligne JMP:
http://www.jmp.com/support/help/13-2/Import_Data_from_the_Internet_or_a_Remote_Comput.shtml