Zugriff auf das Internet über einen ProxyHat jemand eine Datei erfolgreich heruntergeladen (ohne sie als Datentabelle zu öffnen), indem sie ein Skript aus dem Internet über einen Proxy mit JMP verwendet? Wenn ja, wie hast du es gemacht?
Wie könnte ich zum Beispiel das herunterladen? SAS-Logo zu einer Datei auf meinem Computer, während Sie sich hinter einem Proxy befinden?
Re: Zugriff auf das Internet über einen ProxyBrillant, ich akzeptiere sogar das Herunterladen des JMP-Logos anstelle von SAS. Dies scheint auch in Skripts zu funktionieren, die vom Task-Scheduler aufgerufen werden. Für meine einfache Anforderung hier ist, worauf ich gelandet bin:
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" );Vielen Dank @Craige_Hales und @Justin_Chilton
Re: Zugriff auf das Internet über einen ProxyVersuche dies; es funktioniert nicht vor JMP 12, scheint aber sowohl in 12 als auch in 13 zu funktionieren. Es nutzt einen Nebeneffekt @Justin_Chilton wies mich kürzlich darauf hin. Sie sollten daraus eine Funktion machen, wenn Sie sie von mehreren Stellen aus aufrufen müssen.
// 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: Zugriff auf das Internet über einen ProxyHallo Peter,
Ich hätte angeben sollen, dass ich nach einer Skriptlösung zum Herunterladen einer Datei suche, anstatt sie zu öffnen. Ich habe die Frage entsprechend aktualisiert. Das Internet Open scheint Proxy-Informationen vom Internet Explorer zu erhalten, aber in diesem Fall muss ich die Datei bearbeiten, bevor ich sie öffnen kann.
Re: Zugriff auf das Internet über einen ProxyIch bin nicht sicher, ob Sie genau das Richtige für Sie sind, aber die allgemeine JMP-Systemdokumentation zum Herunterladen einer Datei aus dem Internet oder einem Remote-Computer finden Sie in der JMP-Onlinesystemdokumentation:
http://www.jmp.com/support/help/13-2/Import_Data_from_the_Internet_or_a_Remote_Comput.shtml