Accedi a Internet tramite un proxyQualcuno ha scaricato con successo un file (senza aprirlo come tabella dati) utilizzando uno script da Internet tramite un proxy che utilizza JMP? Se è così, come avete fatto?
Ad esempio, come posso scaricare il Logo SAS in un file sul mio computer mentre si trova dietro un proxy?
Re: accesso a Internet tramite un proxyBrillante, accetterò persino il tuo download del logo di JMP anziché di SAS. Anche questo sembra funzionare negli script richiamati dall'utilità di pianificazione. Per il mio semplice requisito ecco cosa sono atterrato su:
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" );Grazie @Craige_Hales e @Justin_Chilton
Re: accesso a Internet tramite un proxyProva questo; non funzionerà prima di JMP 12, ma sembra funzionare sia in 12 che in 13. Usa un effetto collaterale @Justin_Chilton mi ha indicato di recente. Dovresti fare una funzione fuori da questo se hai bisogno di chiamarlo da più di un posto.
// 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: accesso a Internet tramite un proxyCiao Peter,
Avrei dovuto specificare che sto cercando una soluzione di scripting per scaricare un file invece di aprirlo, ho aggiornato la domanda per riflettere questo. Sembra che Internet Open ottenga informazioni proxy da Internet Explorer, ma in questo caso ho bisogno di manipolare il file prima di poterlo aprire.
Re: accesso a Internet tramite un proxyNon sono sicuro che questo sia ciò che stai cercando, ma la documentazione generale del sistema JMP per scaricare un file da Internet o da un computer remoto è contenuta qui nella documentazione del sistema online JMP:
http://www.jmp.com/support/help/13-2/Import_Data_from_the_Internet_or_a_Remote_Comput.shtml