我正在創建一個Java程序,在該程序中我將文件上載到服務器的特定路徑上。我使用jSch爲sftp。 因此,在上傳文件之前,我想檢查給定的目錄是否存在於服務器上。 if(path exists)
//upload file to the location
else
//create the directory and then upload the file.
如何檢查路徑
我想代碼這個想法:你有一個下載按鈕。當你點擊按鈕時,它應該證明文件是否存在。當它存在時,它應該開始下載文件,如果沒有,那麼應該有一個警報。 我知道如何來證明,如果通過PHP的文件存在: if (file_exists(dirname(__FILE__).'/downloads/rawData.zip')) {
echo '<script type="text/javascript" la