Generally, ftp url format is ftp://user[:pass]@ip[:port]/path
But now I got this string:
ftp://dude:[email protected]/@1.1.1.1/fml
It seems it's ambiguous because the parse result can be:
password=1.1.1.1, [email protected]/fml
[email protected]/, path=fml
Should I have to just tell the client this is illegal, or is there any more friendly way to deal with it? Thanks..
Special Characters in Usernames and Passwords
If your remote server requires authentication, you can include username and password in the input url string. Usernames and passwords should have the following special characters percent-encoded:
] [ ? / < ~ # ` ! @ $ % ^ & * ( ) + = } | : " ; ' , > { space
Examples:
http://example.com/path/to/input.avi
https://example.com/path/to/input.mov
ftp://example.com/path/to/input.mp3
sftp://example.com/path/to/input.3gp
https://s3.amazonaws.com/bucket-name/input.mpeg
s3://bucket-name/input.mpeg (shorthand for the full HTTP S3 url)
Examples (with username "user" and password "pass!word"):
http://user:pass%[email protected]/path/to/input.avi
https://user:pass%[email protected]/path/to/input.mov
ftp://user:pass%[email protected]/path/to/input.mp3
sftp://user:pass%[email protected]/path/to/input.3gp
ftp://user:pass%[email protected]/path/to/input.mp3
Some servers require the username include your domain name (username "[email protected]" and password "pass!word"):
http://user%40example.com:pass%[email protected]/path/to/input.avi
https://user%40example.com:pass%[email protected]/path/to/input.mov
ftp://user%40example.com:pass%[email protected]/path/to/input.mp3
sftp://user%40example.com:pass%[email protected]/path/to/input.3gp
ftp://user%40example.com:pass%[email protected]/path/to/input.mp3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With