forgot urlencoding for user and password

This commit is contained in:
Dank074 2019-12-17 21:09:13 -06:00
parent 2a1b1406bc
commit fbf4601db5
2 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
public class FTPUploadService {
private static final String ftpUrl = "ftp://%s:%s@%s/%s;type=i";
@ -15,7 +16,7 @@ public class FTPUploadService {
String user = Emulator.getConfig().getValue("ftp.user");
String pass = Emulator.getConfig().getValue("ftp.password");
String uploadURL = String.format(ftpUrl, user, pass, host, uploadPath);
String uploadURL = String.format(ftpUrl, URLEncoder.encode(user, "UTF-8"), URLEncoder.encode(pass, "UTF-8"), host, uploadPath);
URL url = new URL(uploadURL);
URLConnection conn = url.openConnection();

Binary file not shown.