nacerbaaziz Posted February 28, 2018 Posted February 28, 2018 Hello all I have a question please I have a link to an .exe file for example this linkhttps://www.nvaccess.org/files/nvda/releases/2017.1/NVDA_2017.1.exe I want to check if the link is exists orno surely Without downloading the file is there any function or a way to do this? Thanks in advance
orbs Posted February 28, 2018 Posted February 28, 2018 InetGetSize() returns 0 if the file does not exist (or is empty, for which you can check that @error is non-zero). Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates WinPose - simultaneous fluent move and resize Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
rudi Posted March 15, 2018 Posted March 15, 2018 Hello. As stated in the help file, some servers do *NOT* return the file size, IIRC then the result is ZERO as well. Not all servers will correctly give the file size, especially when using a proxy server. If the returned size is > 0, the file should exist. if not, you could just *START* the download to check with InetGetInfo(), if its download could be started, then abort it. See help file for INetGet() Notes about the "background" Parameter By default the function waits until the download has finished before returning. If the background parameter is set to $INET_DOWNLOADBACKGROUND (1) the function returns immediately and the download continues in the background. The function InetGetInfo() can be used to check the status of the download. It takes the handle returned from InetGet(). Multiple downloads are supported if they are started in background mode. To abort a download call InetClose() and pass it the handle returned by InetGet(). By default AutoIt forces a connection before starting a download. For dial-up users this will prompt to go online or dial the modem (depending on how the system is configured). The options value $INET_FORCEBYPASS (16) disables this behavior. Disabling the behavior can be useful for persistent connects (Broadband, LAN). However, it is also required to work around certain issues in Windows Vista and Windows 7. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
orbs Posted March 15, 2018 Posted March 15, 2018 @rudi, thanks for the heads-up. can you test what @error you get in that scenario from FileGetSize()? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates WinPose - simultaneous fluent move and resize Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
rudi Posted March 15, 2018 Posted March 15, 2018 Hello orbs, Hm, currently I have no URL handy to check. I'll bookmark this and post an update, when I come across a download *NOT* presenting the final file size in the download list of IE/FF/Chrome. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now