forgot urlencoding for user and password
This commit is contained in:
parent
2a1b1406bc
commit
fbf4601db5
@ -6,6 +6,7 @@ import java.io.IOException;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
public class FTPUploadService {
|
public class FTPUploadService {
|
||||||
private static final String ftpUrl = "ftp://%s:%s@%s/%s;type=i";
|
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 user = Emulator.getConfig().getValue("ftp.user");
|
||||||
String pass = Emulator.getConfig().getValue("ftp.password");
|
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);
|
URL url = new URL(uploadURL);
|
||||||
URLConnection conn = url.openConnection();
|
URLConnection conn = url.openConnection();
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user