Re: Redisplay file name on failed upload

From: Date: Tue, 13 Feb 2007 20:10:51 +0000
Subject: Re: Redisplay file name on failed upload
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-248828@lists.php.net to get a copy of this message
Brad Fuller wrote: >> Is it possible to assign form[ upldFile ] = "C:\somepath\somefile" >> or >> form[ upldFile ] = $_FILES['userfile']['name'] > > The "value" attribute of the <input type="file"...> tag is not able > to be > altered or pre-populated for obvious security reasons. > >> The script which does the validation is the same one which contains the >> upload form. I suspect we're completely out of luck - apart from >> validating >> with JavaScript. > > Yup. well no - you don't have any certainty that the javascript is even being run. you still have to check everything server side and assume the javascript was circumvented. javascript validation is purely a mechanism to aid the user - i.e. it makes the form more responsive for honest users with a javascript *enabled* browser by eliminating superfluous trips to the server. > > -Brad >

« previous php.general (#248828) next »