Does the API support convert an url to a valid filename?

Hi, support:
for example, there is an url like “http://www.123.com/SDEW32DSDWE32”, how to convert the url as “http://www.123.com/abc.jpg
Thanks for your help.

@ducaisoft

We are afraid that we cannot fully understand your requirements. Can you please share some more details? Why do you need to convert the URL into file path? Do you want to save the file with the same name as the URL? Are you converting HTML (from URL) into an image?

I want to download the file from the url like this by api not by browser, if the filename is not known, it can not be download byapi, therefore, the url should be converted as a new one with filename.
the code will be like thies:

Dim SeverUrl as string =“http://www.123.com/SDEW32DSDWE32”
Dim LocalPath as string="C:\Temp\abc.jpg"
Dim Suc as boolean 
Suc=UrlDownloadfile(SeverUrl,LocalPath)

therefore, if the filename is not known, the API UrlDownloadfile will fail; if the filename is given a wrong one, though the API UrlDownloadfile will sucess, the downloaded filename may be not always correct that is out of expect and need to use browser to download it to know its true filename.

For this purpose, the url like this should be converted to get out the true filename for download.

@ducaisoft

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLNET-4764

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@ducaisoft

The URL provided by you “http://www.123.com/SDEW32DSDWE32” is already valid and can be used to download a WEB page using the following code snippet:

using (var doc = new HTMLDocument("[http://www.123.com/SDEW32DSDWE32")](http://www.123.com/SDEW32DSDWE32%22)))
{
doc.Save("file.html");
}

WEB page URLs do not necessarily contain an extension or filename but still remain valid, for example, the following code snippet shows saving a page whose address does not contain a filename:

using (var doc = new HTMLDocument("[http://www.123.com/path/")](http://www.123.com/path/%22)))
{
doc.Save("file.html");
}

If you are having trouble saving a particular page, could you provide the URL of that page?

The issues you have found earlier (filed as HTMLNET-4764) have been fixed in this update. This message was posted using Bugs notification tool by avpavlysh