透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件你好,
我想透過 JFrog artifactory http 連結從 zip 資料夾中讀取一些檔案。 我不太確定如何解決以下問題:
1)存取連結時所需的使用者名稱和密碼
2)我使用的腳本可能有問題,它給了我錯誤
我嘗試訪問的連結如下所示(創建了一個假連結以顯示其外觀)
http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip
下面是我整理的腳本草稿,但它不起作用。 有人告訴我,我可以建立 API 金鑰,該金鑰可用於繞過使用者和密碼進行登錄,但無法使其正常運作。 有人可以幫我嗎?
</CODE></DIR></PRE><P> </P><P> </P><P> </P><P> </P></LINGO-BODY><LINGO-LABS id="lingo-labs-683976" slang="en-US" mode="NONE"><LINGO-LABEL>自動化和腳本編寫</LINGO-LABEL><LINGO-LABEL>資料存取</LINGO-LABEL></LINGO-LABS><LINGO-SUB id="lingo-sub-684133" slang="en-US" mode="NONE">回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件</LINGO-SUB><LINGO-BODY id="lingo-body-684133" slang="en-US" mode="NONE"><P><A href="https://community.jmp.com/t5/Uncharted/YouTube-API/m-p/400049#U400049" class="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa" target="_blank">YouTube API</A>顯示 api 金鑰的一種工作方式。 他們提供的文件是否告訴您如何提供您收到的文件?</P></LINGO-BODY><LINGO-SUB id="lingo-sub-684168" slang="en-US" mode="NONE">回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件</LINGO-SUB><LINGO-BODY id="lingo-body-684168" slang="en-US" mode="NONE"><P> </P><P><SPAN>使用以下命令部署文件</SPAN><SPAN class=""><STRONG>API金鑰</STRONG></SPAN><SPAN>在標頭中,您可以使用以下命令:</SPAN></P><PRE class=""><CODE>curl -H "X-JFrog-Art-Api:ABcdEF" -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt" -T Desktop/myNewFile.txtrequest = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip" ),
Method( "GET" ),
);
zip = request << Send;
za=open(zip,"zip");
zipfiles=za<
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的一些文件克雷格,
1) 我們也可以使用 open() 開啟 zip 資料夾並透過網頁下載特定檔案嗎?
2)我們可以透過頁面開啟並讀取zip資料夾中的一個檔案並只從中獲取一些文字嗎?
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件捲髮-H指定一個標頭,這需要您使用新的 HTTP 請求。 open() 可以新增查詢字串,但不能新增標頭,因此它不會執行您需要的操作。
help->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting indexhelp->scripting index幫助->腳本索引
我想你會需要
headers({"X-JFrog-Art-Api:ABcdEF"})
但不是查詢字串和字段。
取得 zip 檔案後,您可以使用 JMP 的 zip 檔案支援來取得解壓縮的成員。
您可以使用下載而不是發送:
download a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a filedownload a file下載文件
@bryan_boone
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件如果我使用下載,它會下載整個 zip 嗎? 我不想要整個 zip 文件,因為它很大。 我想打開 zip 資料夾並獲取我想要的檔案。
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的一些文件是的,它下載整個 zip 文件,而不是會員。 除非 API 具有取得較小區塊的方法,否則您需要取得全部內容並且僅解壓縮您需要的內容。 許多 API 允許您透過製作您想要的專案的自訂 zip 檔案來實現您想要做的事情。 您可能需要閱讀 API 文件才能解決這個問題。
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件另外,您的範例是 PUT,而不是 GET。 您可能從文件中將新資料放入資料庫的部分中取得了 PUT 範例。 可能有一個 GET 範例用於從資料庫取得舊資料。 GET 和 PUT 是 REST-ful 伺服器運作方式的一部分,還有其他動詞。
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件不成功。 我發現有 2 個選項可以使用 api 金鑰進行身份驗證並從 artifactory 下載檔案:
1)curl -uadmin:API-Key -ocommons-collections-3.1.jar http://localhost:8081/artifactory/jcenter/apache-collections/commons-collections/3.1/commons-collections-3.1.jar
2)curl -H「X-JFrog-Art-Api:API金鑰」-ocommons-collections-3.1.jar http://localhost:8081/artifactory/jcenter/apache-collections/commons-collections/3.1/commons-collections-3.1.jar
由於使用了標頭,我嘗試了下面腳本中的 2),但它沒有下載文件,而是下載了我在下面發布的一些奇怪的字元。 我不確定哪裡出了問題。
temp.log 檔案包含以下訊息,而不是 url 中的內容
<meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content=""IE=edge"" /><meta name="viewport" content=""width" /><元名稱=importmap-type content=systemjs-importmap><連結rel=apple-touch-icon 大小=180x180 href=./apple-touch-icon.png><連結rel=圖示類型=圖片/png 大小=32x32 href=./favicon-32x32.png><連結rel=圖示類型=圖片/png 大小=16x16 href=./favicon-16x16.png><連結rel=掩掩碼-icon href=./safari-pinned-tab.svg color=#f5f5f2><script type="systemjs-importmap" src="https://community.jmp.com/ui/imports-map/imports.json"> < link rel =preload href=/ui/externals/single-spa/lib/umd/single-spa.min.js as=script>JFrog@ keyframes heartbeatOut {從{opacity:1}50%{opacity:0;transform:scale(.8)}到{opacity:0;transform:scale(.8)}}@keyframes心跳{from{transform:scale3d(1 ,1) ,1)}50%{transform:scale3d(1.15,1.15,1.15)}到{transform:scale3d(1,1,1)}}.pounding-heart-container{display:none;align-items: center;justify -內容:中心;位置:絕對;左:0;右:0;頂部:0;底部:0;z-index:9999999999;背景:線性漸變(132.49deg,#414857 14.17%,#252831 83.36 %) }.pounding-heart-container.show-splash{display:flex}.logo{width:130px;-webkit-backface-visibility:hidden;-ms-transform:translateZ(0);-webkit-transform:translateZ (0 );transform:translateZ(0)}.logo.pulse{動畫:heartbeat 1.7s 無限}.logo.zoom-out{動畫:heartbeatOut 向前150ms}

<script src="
https://community.jmp.com/ui/js/chunk-vendors.61f2dc48.js">
request = NewHTTPRequest(
URL( "http://http://docker-virtual.artifactory.xxx.com:80/ui/repos/tree/General/Sxxxx/logs/ABC/1111_23456_1_test.zip/test.log" ),
Method( "GET" ),
headers({"X-JFrog-Art-Api: API-Key"})
);
zip = request << download("D:\temp.log", "replace", "show_progress");
回覆:透過 JFrog artifactory http 連結開啟並下載 zip 資料夾中的幾個文件嗨克雷格,
我發現了問題並解決了它。 問題出在 URL 上。將“ui/repos/tree/General”替換為“artifactory”,然後我就可以下載整個 zip 文件,而不是特定文件。
感謝您的協助