I use your control to upload images to my web server. After the upload is complete, I create several thumbnails and do further validation such as making sure the file really is a .jpg file etc... When the file is renamed to have a .jpg extension but really is not a .jpg, I detect this and delete the file so that it is no longer on the web server. Unfortunately, the screen then refreshes and the progress bar complains that it can't find the file. Is there a way to do this so that the progress bar knows that the file was bad?
To avoid the error in the progress bar, don't delete the file yourself. Instead only call InputFile.MoveTo() after you've successfully validated the file. If you don't call MoveTo(), NeatUpload will automatically delete the file for you at the end of the request.
It's more complicated to do exactly what you want in terms of having the progress bar indicate that the file was bad. You'd need to create a custom UploadStorageProvider that put the validation code in there instead of in the code for your page. But...
An easier solution is to just have your page display the error message instead of the progress bar. If you want to prevent most accidental uploads of the wrong types of files, you can use a RegularExpressionValidator to check that the filename ends with .jpg. When client-side validation is enabled and available, this will also cause the user to see an error message before the upload even starts.
You can use InputFile.TmpFile if you are using the FilesystemUploadStorageProvider (which is the default). However, it's use is deprecated since not all UploadStorageProviders can support it. I better way would be to use InputFile.FileContent to get a Stream on the file and then copy that stream to another file or use it directly to create your thumbnails etc. Of course, if you copy it to another file you'll need to remember to remove that file if validation fails.
Also, if you access InputFile.FileContent, be sure to close the Stream it gives you when you are done with it.