mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
GetFileName fix for DownloadAndUpload
This commit is contained in:
parent
1e07597bc4
commit
82ac01f3fe
2 changed files with 6 additions and 6 deletions
|
@ -251,7 +251,7 @@ public static string AddSlash(string url, SlashType slashType, int count)
|
|||
return url;
|
||||
}
|
||||
|
||||
public static string GetFileName(string path, bool checkExtension = false, bool urlDecode = false)
|
||||
public static string GetFileName(string path, bool urlDecode = false)
|
||||
{
|
||||
if (urlDecode)
|
||||
{
|
||||
|
@ -264,14 +264,14 @@ public static string GetFileName(string path, bool checkExtension = false, bool
|
|||
}
|
||||
}
|
||||
|
||||
if (path.Contains("/"))
|
||||
if (path.Contains('/'))
|
||||
{
|
||||
path = path.Remove(0, path.LastIndexOf('/') + 1);
|
||||
path = path.Substring(path.LastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
if (checkExtension && !Path.HasExtension(path))
|
||||
if (path.Contains('?'))
|
||||
{
|
||||
return null;
|
||||
path = path.Remove(path.IndexOf('?'));
|
||||
}
|
||||
|
||||
return path;
|
||||
|
|
|
@ -1283,7 +1283,7 @@ private bool DownloadAndUpload()
|
|||
{
|
||||
string url = Info.Result.URL.Trim();
|
||||
Info.Result.URL = string.Empty;
|
||||
string filename = URLHelpers.GetFileName(url, true, true);
|
||||
string filename = URLHelpers.GetFileName(url, true); // TODO: Set filename in task creation
|
||||
|
||||
if (!string.IsNullOrEmpty(filename))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue