Why don't you just do the sql insert *after* the file upload function?:
Pseudocode:
if( NOT file upload attack, wrong file type, etc.){
//copy the file to the permanaent location
//call function to insert file details into the database
}
else{
//echo error to user
}
On 3/9/02 10:21 AM, "Carl E Shmidt" <[EMAIL PROTECTED]> wrote:
> I have a standard multipart/enc form to allow users to upload files.
> Pseudocode:
> //call function to insert file details into the database
> if( NOT file upload attack, wrong file type, etc.){
> //copy the file to the permanaent location
> }
> else{
> //delete the record of file details from the database
> }
>
> I can have the file upload successfully, and the record is inserted into the
> database. The problem is that if there are errors on file upload, then the
> record is never deleted from the database. The file upload is resubmitting
> to the same page, and no redirection takes place. WHat's going on?
>
> Carl
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php