通過代理訪問互聯網有沒有人使用JMP使用來自互聯網的腳本通過代理成功下載文件(不將其作為數據表打開)?如果是這樣你是怎麼做到的?
例如,我怎麼能下載 SAS徽標在代理後面的計算機上的文件?
回复:通過代理訪問互聯網很棒,我甚至會接受您下載JMP的徽標而不是SAS的徽標。 這似乎也適用於從任務調度程序調用的腳本。 對於我的簡單要求,這裡是我登陸的:
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" );謝謝 @Craige_Hales 和 @Justin_Chilton
回复:通過代理訪問互聯網試試這個;它在JMP 12之前不起作用,但似乎在12和13中都有效。它使用副作用 @Justin_Chilton 最近我向我指出。如果您需要從多個地方調用它,您應該使用此功能。
// 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 );回复:通過代理訪問互聯網你好彼得,
我應該指定我正在尋找一個腳本解決方案來下載文件而不是打開它,我更新了問題以反映這一點。 Internet Open似乎從Internet Explorer獲取代理信息,但在這種情況下,我需要在打開文件之前操作該文件。
回复:通過代理訪問互聯網我不確定這是你所追求的,但是從JMP在線系統文檔中包含了從互聯網或遠程計算機下載文件的一般JMP系統文檔:
http://www.jmp.com/support/help/13-2/Import_Data_from_the_Internet_or_a_Remote_Comput.shtml