[thelist] how to tell if a file has been submitted for upload?

Dunstan Orchard dunstan at 1976design.com
Tue Oct 1 17:04:01 CDT 2002

Ah! I found out how to do it after days of searching.

I guess I could submit this as a tip?
Maybe everyone else knows it though :o/

To check if a file upload form element (in this case called 'upload_image')
contains anything use the following php:

if(($upload_image <> "none") && ($upload_image <> ""))
	put your 'if' code in here
        it will be run if the user had submitted a file

This lets you cope with forms that have optional file uploads in them.

Dorset, England

More information about the thelist mailing list