I need Mac OSX program written in Objective C which will download a file from a website. The file is 3 to 5MB in size. The file is in the webservers protected area so you will first have to authenticate with userid and password (supplied).
Before downloading, your program will check if a new version is available. I will provide a url which returns the most recent version of the file, which will be an integer. This url is on another webservers protected area and the same userid and password will work to get in.
The “version number” URL has the option to reject the user in which case an error message will be returned instead of an integer version number.
If the webserver has a more recent version of the file then your program should download the file. Also, your program should store the new version number in a separate file so that the next time the file is requested it will have a way of knowing the file is updated and that it won’t redownload it again.
During downloading, the program will display a progress bar in a small popup window indicating % completed.
There will be a cancel button on the progress window which will optionally abort the downloading.
Your program should accept a delegate which will optionally receive delegate messages for:
1. Download progress
2. Download completed
3. Already at latest version
4. Download cancelled
Your program be configurable so that the caller can specify the
1. User ID
3. Download directory – you will store the version number file here as well as the “big file”
4. Local file name
5. Remote “Check version number” URL
6. Remote file URL
Your program should be careful not to destroy the old version of the file before completely receiving the new version. For example, if the user Cancels (or if the download was interrupted for any reason) then, on the local machine we should still have the old file. To facilitate this, you should download into a different filename and rename/move the file at the last step of the process after download is completed.