My question is pretty straightforward. I have an exe file on an ftp server with a version of 1.0.0.0. I’d like to download it, but only if the version is greater than a certain pre-set value. (All of this inside a C# desktop application).
I read online that it isn’t possible to tell the version of a file through FTP without downloading it first. Is this correct? (I would rather not do this as the file is fairly large and will not need to be downloaded most of the time).
If it is, the solution I saw recommended was to create a text file in the FTP directory that contained the version of the target exe file. Obviously it would not be large so it could be downloaded quickly. Is this the best solution if I can’t grab the exe version directly?
Thanks for the help!
You can’t because FTP has no protocol specification for the file version. Depending on the FTP server you are using, in the DIR command you may have the datetime information about the file. So yes in my opinion having the metadata file is the best simpler solution. Another more challenging solution is to craft some FTP source code to return the version information along with the DIR command, as far as I know ftp protocol is not restrictive at all about the details of a dir command, but it is not easy so is up to you to evaluate the benefit and keep in mind that was a solution working just with you server client pair. If you don’t mind about the protocol, having a Mercurial ( or other verioning system ) repository served would be probably the smartest opion.